From 34bc597d39506135c1effbfaaa61cb4f39ce58c8 Mon Sep 17 00:00:00 2001 From: cc-dan Date: Sat, 14 Mar 2026 07:19:13 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=BB=98=E8=AE=A4=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20+=20Claude/Codex=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/app.js | 13 +++++++++++-- public/style.css | 12 ++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index 2ce7369..ac11d6b 100644 --- a/public/app.js +++ b/public/app.js @@ -1541,7 +1541,7 @@ function createMsgElement(role, content, attachments = []) { const div = document.createElement('div'); - div.className = `msg ${role}`; + div.className = `msg ${role}${role === 'assistant' ? ' agent-' + currentAgent : ''}`; if (role === 'system') { const bubble = document.createElement('div'); @@ -1553,7 +1553,13 @@ const avatar = document.createElement('div'); avatar.className = 'msg-avatar'; - avatar.textContent = role === 'user' ? 'U' : (currentAgent === 'codex' ? 'O' : 'C'); + if (role === 'user') { + avatar.textContent = 'U'; + } else if (currentAgent === 'codex') { + avatar.innerHTML = ``; + } else { + avatar.textContent = '🦀'; + } const bubble = document.createElement('div'); bubble.className = 'msg-bubble'; @@ -2775,6 +2781,9 @@ if (currentSessionId) { send({ type: 'set_mode', sessionId: currentSessionId, mode: currentMode }); } + if (currentMode === 'default') { + appendSystemMessage('⚠ 由于项目设计与 CLI 原生逻辑不同,默认模式的授权申请功能暂未实现,建议搭配 Plan 或 YOLO 模式使用。'); + } }); msgInput.addEventListener('input', () => { diff --git a/public/style.css b/public/style.css index e618cf8..ba3621e 100644 --- a/public/style.css +++ b/public/style.css @@ -1015,6 +1015,18 @@ body.session-loading-active { } .msg.user .msg-avatar { background: var(--bg-bubble-user); color: #fff; } .msg.assistant .msg-avatar { background: var(--success); color: #fff; } +.msg-avatar svg { display: block; flex-shrink: 0; } +/* Claude avatar: pixel crab emoji on accent bg */ +.msg.assistant.agent-claude .msg-avatar { + background: var(--accent); + color: #fff; + font-size: 18px; +} +/* Codex avatar: GPT logo on green bg */ +.msg.assistant.agent-codex .msg-avatar { + background: #10a37f; + color: #fff; +} .msg-bubble { padding: 12px 16px;