diff --git a/app/server/public/index.html b/app/server/public/index.html
index 30bf3d6..3044588 100644
--- a/app/server/public/index.html
+++ b/app/server/public/index.html
@@ -54,7 +54,7 @@
/* 状态栏「压缩」图标按钮:主操作色(蓝色),与其他 stop-link 区分(终止/选择模型是灰) */
.stop-link.icon-only.icon-primary { color: var(--active); }
.stop-link.icon-only.icon-primary:hover { color: #2854d6; }
- /* 推到 phase-bar 最右侧(独立动作,与左侧状态/选择模型区分) */
+ /* 推到 phase-bar 最右侧(独立动作,与左侧状态区分;「选择模型/模式」与压缩同列右靠) */
.phase-bar .phase-bar-right { margin-left: auto; }
/* 定时任务状态条:整条可点,弹详情窗(改频次/提示词、删除;创建走 AI 的 schedule 工具),紫色调区别于状态栏;
左侧 3px 竖条与侧边栏定时任务会话的紫色标记同一语义。
@@ -91,6 +91,13 @@
/* 会话模式徽标(profile 绑定时的标题小图标;尺寸显式定,不依赖 .ic 默认值) */
.prof-badge { display: inline-flex; align-items: center; margin-right: 4px; opacity: .62; flex: none; }
.prof-badge .ic { width: 13px; height: 13px; }
+ /* 各模式固定色(头部/抽屉/弹窗下拉旁同一套) */
+ .prof-badge.prof-lab .ic { color: #8B5CF6; }
+ .prof-badge.prof-zero .ic { color: #EF4444; }
+ /* 弹窗模式行:下拉选中 + 当前模式图标(取代纵向选项组,省垂直空间) */
+ .msw-prof { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; color: var(--ink); border-top: 1px solid #dde1ea; }
+ .msw-prof-label { flex: none; }
+ .msw-prof select { flex: 1; min-width: 0; border: 1px solid #dde1ea; border-radius: 8px; padding: 5px 8px; font-size: 13px; background: #fff; color: var(--ink); }
/* welcome 头像兼做「选择模型/模式」入口(与聊天态的「选择模型」同一弹窗) */
.logo-badge { cursor: pointer; }
@@ -123,7 +130,7 @@
--
-
+
diff --git a/app/server/public/js/core.js b/app/server/public/js/core.js
index aa23ece..d0cd8f9 100644
--- a/app/server/public/js/core.js
+++ b/app/server/public/js/core.js
@@ -199,33 +199,34 @@
}
// ---------- 会话模式徽标 ----------
- // 会话绑定 profile 时,标题(顶部/抽屉行)前缀小图标;''=默认不显示;未知组合回退圆点。
+ // 会话绑定 profile 时在标题(头部/抽屉行/弹窗下拉旁)显示小图标:''=默认不显示;各模式固定色(CSS .prof-*);
+ // 未知名兑底圆点(无色);tooltip 只提示当前模式,不另显文字。
const PROFILE_BADGES = {
lab: '
',
- zero: '
',
+ zero: '
',
};
function profileBadgeHtml(p) {
if (!p) return '';
- return '
' +
- (PROFILE_BADGES[p] || '') + '';
+ return '
' +
+ (PROFILE_BADGES[p] || '') + '';
}
function renderHeader() {
const c = $('header-center');
+ // welcome(含刚 newChat)一律清空:newChat 会停在 welcome,不重刷会残留旧会话标题
if (state.view !== 'chat' || !state.sessionId) { c.innerHTML = ''; return; }
- // 顶部 icon 跟随会话自身的助手类型(而非 welcome 当前选中项)
- const modeIcon = (MODES[state.sessionType] && MODES[state.sessionType].icon) || '';
+ // 顶部只显会话模式徽标(助手类型 icon 退位;''=默认不显),颜色按模式区分,tooltip 提示当前模式
const title = document.createElement('div');
title.className = 'header-title';
title.style.cursor = 'pointer';
title.title = '点击重命名';
- title.innerHTML = modeIcon + profileBadgeHtml(state.profile) +
+ title.innerHTML = profileBadgeHtml(state.profile) +
'';
title.addEventListener('click', renameSession); // 点标题重命名(同步 index)
c.innerHTML = '';
c.appendChild(title);
}
- // ---------- 模式切换已移除:新建会话固定用 state.mode(secretary),历史会话的
- // 助手类型由 sessionType 决定(旧 vision 会话仍正常渲染顶部 icon)。 ----------
+ // ---------- 模式切换已移除:新建会话固定用 state.mode(secretary),助手类型不再占顶部 icon
+ // (历史 vision 会话的类型字段保留,仅不再在标题处展示)。 ----------
diff --git a/app/server/public/js/sessions.js b/app/server/public/js/sessions.js
index 6ca41f8..93f26bf 100644
--- a/app/server/public/js/sessions.js
+++ b/app/server/public/js/sessions.js
@@ -497,20 +497,20 @@
} catch (e) {
modelsHtml = '
读取模型列表失败:' + e.message + '
';
}
- // ---------- 模式区:prompt+tools 组合(名单来自 /api/system/status;拉不到 = 整区隐藏,不影响选模型) ----------
+ // ---------- 模式行:下拉选中(名单来自 /api/system/status;拉不到 = 整行隐藏,不影响选模型) ----------
let profHtml = '';
const names = await loadProfileNames();
if (names.length) {
const cur = state.sessionId ? state.profile : state.pendingProfile;
- const prow = (p, label) => '
' +
- '
' + label +
- (cur === p ? ' 当前' : '') + '
';
- profHtml = '
' +
- prow('', '默认(随模型配置)') + names.map(p => prow(p, esc(p))).join('') + '
';
+ const opts = [''].concat(names).map(p =>
+ '
').join('');
+ profHtml = '
模式:' +
+ '' + profileBadgeHtml(cur) + '' +
+ '
';
}
list.innerHTML = modelsHtml + profHtml;
footer.textContent = state.sessionId
- ? '共 ' + avail + ' 个模型可用;模式切换下一轮迭代即生效'
+ ? '共 ' + avail + ' 个模型可用'
: '预选项在首条消息建档时生效';
}
function closeModelSwitch() { $('bind-model-modal').classList.add('hidden'); }
@@ -526,27 +526,34 @@
return PROFILE_NAMES;
}
- function choosePendingModel(modelId) { // welcome 无会话:记预选,ensureSession 建档时透传;不关窗以便继续挑模式
+ function choosePendingModel(modelId) { // welcome 无会话:记预选,ensureSession 建档时透传;选完即关窗(toast 提示),重开弹窗靠就地标记显「预选」
state.pendingModel = modelId;
+ closeModelSwitch();
toast('新会话将用 ' + modelId);
- openModelSwitch(); // 重画「预选」标记
}
- async function chooseProfile(name) { // name='' = 默认(解绑随模型配置)
+ async function chooseProfile(name) { // 下拉选中即绑/即预选;不重开弹窗(下拉天然保持选中项),只就地换旁侧图标
if (state.sessionId) {
try {
await req('POST', '/api/sessions/' + state.sessionId + '/bind', { profile: name });
- state.profile = name;
- toast(name ? '会话模式已切换:' + name + '(下一轮迭代即生效)' : '已切回默认模式');
- renderHeader();
- loadSessionList(); // 抽屉标题徽标同步
- } catch (e) { return toast('切换失败:' + e.message); }
+ } catch (e) {
+ const sel = $('bind-prof-select');
+ if (sel) sel.value = state.profile; // 失败回退选项,下拉不谎报
+ return toast('切换失败:' + e.message);
+ }
+ state.profile = name;
+ const row = (state.sessions || []).find(x => x.id === state.sessionId); // 同步本地缓存后重画抽屉(纯本地,不重拉列表)
+ if (row) row.profile = name;
+ renderDrawerList();
+ toast(name ? '会话模式已切换:' + name + '(下一轮迭代即生效)' : '已切回默认模式');
} else {
state.pendingProfile = name;
state.profile = name;
toast(name ? '新会话模式:' + name : '新会话用默认模式');
}
- openModelSwitch(); // 重画模式区「当前」标记
+ renderHeader(); // 头部徽标变化
+ const ic = $('bind-prof-ic'); // 弹窗下拉旁图标就地更新(占位 span 常驻,默认态内容为空)
+ if (ic) ic.innerHTML = profileBadgeHtml(name);
}
async function bindModel(modelId) {
if (!state.sessionId) return;