diff --git a/README.CUSTOM.md b/README.CUSTOM.md index 4367bcd..5d590e4 100644 --- a/README.CUSTOM.md +++ b/README.CUSTOM.md @@ -36,8 +36,9 @@ DSH 桌面版(本机安装于 `E:\DeepSeekHarness`,路径按实际调整) | 6 | `client.js` CSS | dock 的 `overflow: hidden` → `visible`(否则弹出的卡片会被父容器裁掉) | | 7 | `client.js` `mountPendingSelector` | 移除新建会话时的「新会话默认凭证」选择器 | | 8 | `client.js` `apply()` | 注释掉 `plugins.detail.section` 注册(移除插件详情页面板)。**保留** `settings.models.provider-card`(改 Key / 拉模型列表的唯一 UI 入口) | -| 9 | `client.js` `applyMode` | 隐藏「当前 API Key」多 Key 来源下拉,且不再回显 Key 内容 | +| 9 | `client.js` `applyMode` | 隐藏「当前 API Key」多 Key 来源下拉;Key 提示区分「已配置可更换 / 未配置可添加」,且不回显 Key 内容 | | 10 | `index.js` | `DISPLAY_NAME` 由 `WorkBuddy 中国区` 改为 `WorkBuddy`(不显示区服) | +| 11 | `client.js` `mountModelEditor` | 「模型目录」改为**可折叠**(默认收起),避免模型列表过长;Key 输入与「添加并使用」始终可用,未配置 Key 的机器可直接填入 | 代码内均以 `[自用定制 2026-10-10]` 注释标记,便于日后与上游 diff。 diff --git a/client.js b/client.js index 9b152a5..cbe4390 100644 --- a/client.js +++ b/client.js @@ -794,8 +794,12 @@ window.__ModuleLoader__.load({ return option; })); if (activeApiKeyId) keySelect.value = activeApiKeyId; - // [自用定制 2026-10-10] 不回显正在使用的 API Key - keyHint.textContent = token ? "" : (activeApiKey ? "" : "未检测到可用 API Key,可输入 Key 保存"); + // [自用定制 2026-10-10] 不回显 Key 内容,但明确区分「已配置可更换 / 未配置可添加」 + keyHint.textContent = token + ? "" + : activeApiKey + ? "已配置。要更换:粘贴新的 API Key 后点「添加并使用」" + : "尚未配置。粘贴你的 WorkBuddy API Key,然后点「添加并使用」"; keyHint.title = ""; saveKeyButton.textContent = "添加并使用"; removeKeyButton.hidden = !activeApiKey || activeApiKey.kind !== "dsh"; @@ -1164,8 +1168,33 @@ window.__ModuleLoader__.load({ } function mountModelEditor(host) { - const heading = document.createElement("strong"); + // [自用定制 2026-10-10] 「模型目录」改为可折叠,默认收起,避免列表过长。 + let collapsed = true; + const toggle = document.createElement("button"); + toggle.type = "button"; + toggle.setAttribute("aria-expanded", "false"); + Object.assign(toggle.style, { + display: "flex", + alignItems: "center", + gap: "6px", + width: "100%", + padding: "2px 0", + border: "0", + background: "transparent", + color: "inherit", + font: "inherit", + fontWeight: "600", + fontSize: "13px", + textAlign: "left", + cursor: "pointer", + }); + const caret = document.createElement("span"); + caret.setAttribute("aria-hidden", "true"); + caret.style.width = "12px"; + caret.textContent = "▸"; + const heading = document.createElement("span"); heading.textContent = "模型目录"; + toggle.append(caret, heading); const actions = row(); const fetchButton = button("获取可用模型"); const addButton = button("添加模型"); @@ -1180,7 +1209,16 @@ window.__ModuleLoader__.load({ Object.assign(list.style, { display: "flex", flexDirection: "column", gap: "8px" }); Object.assign(message.style, { fontSize: "12px", minHeight: "18px" }); actions.append(fetchButton, addButton, resetButton, saveButton); - host.append(heading, actions, list, candidates, message); + const listWrap = document.createElement("div"); + Object.assign(listWrap.style, { display: "none", flexDirection: "column", gap: "8px", width: "100%" }); + listWrap.append(list, candidates); + toggle.addEventListener("click", () => { + collapsed = !collapsed; + caret.textContent = collapsed ? "▸" : "▾"; + toggle.setAttribute("aria-expanded", collapsed ? "false" : "true"); + listWrap.style.display = collapsed ? "none" : "flex"; + }); + host.append(toggle, actions, listWrap, message); let models = null; let revision; let busy = false;