v2: 移除header-sub,在header-title前添加模式SVG图标作为标识区分

This commit is contained in:
2026-09-03 14:16:45 +08:00
parent 4bcb8467a8
commit f640888be2
2 changed files with 11 additions and 9 deletions
+6 -6
View File
@@ -55,18 +55,18 @@ input, textarea { font: inherit; color: inherit; border: 0; outline: none; backg
.header .icon-btn:active { background: var(--surface); }
.header-center {
flex: 1; min-width: 0;
display: flex; flex-direction: column; align-items: center; justify-content: center;
gap: 1px; text-align: center;
display: flex; align-items: center; justify-content: center;
text-align: center;
}
.header-title {
font-size: 15px; font-weight: 600; line-height: 1.3;
max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
display: flex; align-items: center; gap: 5px; justify-content: center;
}
.header-sub {
font-size: 11px; color: var(--gray); line-height: 1.3;
max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
.header-mode-icon {
width: 17px; height: 17px; flex: none;
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.header-sub .mode { color: var(--active); }
/* ================= 主内容区 ================= */
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
+5 -3
View File
@@ -350,10 +350,12 @@
function renderHeader() {
const c = $('header-center');
if (state.view !== 'chat' || !state.sessionId) { c.innerHTML = ''; return; }
// 会话状态改由顶部 phase-bar 状态胶囊展示(自 index 同步);标题下仅保留模式文案
const modeIcons = {
secretary: '<svg class="header-mode-icon" viewBox="0 0 24 24"><path d="M6 3h12l4 6-10 13L2 9z"></path><polyline points="2 9 22 9"></polyline><polyline points="10 3 8 9 12 22"></polyline><polyline points="14 3 16 9 12 22"></polyline></svg>',
vision: '<svg class="header-mode-icon" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"></rect><circle cx="8.5" cy="8.5" r="1.5"></circle><polyline points="21 15 16 10 5 21"></polyline></svg>',
};
c.innerHTML =
'<div class="header-title">' + esc(state.sessionTitle || state.sessionId) + '</div>' +
'<div class="header-sub"><span class="mode">' + esc(MODES[state.mode].label) + '</span></div>';
'<div class="header-title">' + (modeIcons[state.mode] || '') + esc(state.sessionTitle || state.sessionId) + '</div>';
}
// ---------- 模式切换区 ----------