Merge pull request 'fix: 修复 deploy 工作流缺少 Node.js 导致 checkout 失败的问题' #72

Merged
huanghaosheng merged 61 commits from develop into main 2026-06-14 14:37:27 +08:00
4 changed files with 37 additions and 17 deletions
Showing only changes of commit dffc8aa538 - Show all commits

View File

@@ -265,6 +265,11 @@ body {
margin-bottom: 4px;
}
.video-placeholder__hint {
font-size: 0.72rem;
opacity: 0.6;
}
.video-indicator {
position: absolute;
bottom: 16px;

View File

@@ -173,6 +173,16 @@ function App() {
<span></span>
</div>
)}
{isConnected && !isCameraOn && (
<div className="video-placeholder">
<svg className="video-placeholder__icon" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.2" strokeLinecap="round" strokeLinejoin="round">
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z" />
<circle cx="12" cy="13" r="4" />
</svg>
<span></span>
<span className="video-placeholder__hint"></span>
</div>
)}
</div>
{/* 视频下方控制栏 */}

View File

@@ -58,15 +58,15 @@ export function ChatPanel({ messages, currentReply, connectionStatus, onSendText
<div className="chat-panel chat-panel--empty">
<span className="chat-panel--empty-icon">💬</span>
<p></p>
<span className="chat-panel--empty-hint"> AI </span>
<span className="chat-panel--empty-hint"> AI </span>
</div>
);
}
return (
<div className="chat-panel chat-panel--empty">
<span className="chat-panel--empty-icon">🎙</span>
<p></p>
<span className="chat-panel--empty-hint">AI </span>
<span className="chat-panel--empty-icon">💬</span>
<p></p>
<span className="chat-panel--empty-hint"></span>
</div>
);
}

View File

@@ -284,21 +284,26 @@ export function useVisionSession() {
/** 启动会话 */
const startSession = useCallback(async () => {
// 1. 获取摄像头和麦克风
await startCamera();
setIsCameraOn(true);
const micStream = await startMic();
if (!micStream) {
showToast("无法获取麦克风权限", "error");
return;
}
setIsMicOn(true);
// 2. 连接 WebSocket
// 1. 连接 WebSocket必须
connect();
// 3. 启动 VAD传入麦克风 stream
await startVAD(micStream);
// 2. 尝试获取摄像头(可选
try {
await startCamera();
setIsCameraOn(true);
} catch {
console.warn("[Session] 无法获取摄像头权限,将以纯文本模式运行");
}
// 3. 尝试获取麦克风(可选)
const micStream = await startMic();
if (micStream) {
setIsMicOn(true);
// 4. 启动 VAD仅在麦克风可用时
await startVAD(micStream);
} else {
console.warn("[Session] 无法获取麦克风权限,将以文本输入模式运行");
}
}, [startCamera, startMic, connect, startVAD]);
/** 结束会话 */