中文EN

dsh-model-fold

model已测通过npmMIT

把 DSH 模型选择器按来源(provider)分组:菜单只列来源与其模型数,悬停来源即在右侧滑出该来源的模型子面板(默认);切换为面板模式后改为单击来源滑出,或改为在列表内就地展开,双击来源标题即可在 悬浮 -> 面板 -> 列表 三者间循环切换;当前使用的模型一眼可见。纯 DOM 增强、零侵入——面板是插件自建 DOM 并挂载到 body,选择通过程序化点击原菜单真实按钮完成,不移动也不删除任何 React 管理的节点,因此不影响原组件渲染,并能与其他 UI 插件共存。配色与排版跟随宿主:复用官方 --dsw-* 主题变量,背景保证不透明、对比度充足,来源清单与子集清单共用同一套尺寸与色值

下载量 / Downloads
1,488
依赖体积 / node_modules
434.46 MB
测试时间 / Tested
2026-11-06
DSH 版本 / Version
0.2.2-rc.1

安装

dsh plugin --profile web add dsh-model-fold

沙箱测试结果

阶段结果
1 安装✓
2 列装✓
3 挂载✓
4 启动—

四阶段在隔离沙箱里跑:安装(有网)→ 列装 → 挂载 → 启动(后三步断网)。

README

dsh-model-fold 📋

模型菜单别再一条道排到底。 给 DeepSeek Harness(DSH)的模型选择菜单加按来源(provider)分组的导航能力。

Stop scrolling one endless model list. Group the DSH model picker by provider — the menu lists sources first, and each source's models open in a slide-in side panel (hover / click) or inline below the title.

三种模式 / Three modes

悬浮模式(默认) · 列表模式

![悬浮模式](docs/images/mode-hover.png) · ![列表模式](docs/images/mode-list.png)

鼠标划过来源 → 右侧滑出该来源的模型;移开自动收起 · 点来源 → 在下方就地展开该来源的模型

第三种是面板模式(panel):样子与悬浮模式相同,但需要单击来源才滑出面板(不做悬停触发)。
左下:折叠后的来源列表(DeepSeek (4)、OpenSquilla TokenRhythm 网关 (23)…)
右侧:悬停/点击来源后从右滑出的模型子面板(DeepSeek-V4.1-Flash、GLM-5.3、MiniMax-M3、Kimi-K3…)
底部:设置条 —— 一键切换模式与字号
Left: the folded source list · Right: the slide-in model panel · Bottom: mode + font-size switcher

解决什么问题 / The problem

接了三五个来源之后,模型菜单能拉出一屏还滚不完——DeepSeek、GLM、MiniMax、Qwen、Kimi 二十几个模型挤在一起,每次选模型都要眯着眼找。

Add three or five providers and the model menu runs off the screen — two dozen models jumbled together, every switch a squint-and-hunt exercise.


功能亮点(v0.5.0,三模式)

  • 🖱 悬浮展开(默认):鼠标划过来源标题,该来源的模型就从右侧滑出;移开自动收起。不用点击,选模型更快。
  • 📋 来源优先:菜单只列来源(▾ 箭头 + 来源名 + 模型数),一屏看清有几个来源。
  • 👁 当前来源与模型一眼可见:正在使用的来源标注 当前·模型名(加粗 + 品牌色),子面板内选中项保留 ✓。
  • 🔄 三模式自由切换:双击任意来源标题循环切换 悬浮 → 列表 → 面板(即 hover → inline → panel);菜单底部设置条也可直接点选,选择即时生效并记住。
  • 🔤 面板内调字号:设置条提供 10 / 11 / 12 / 13 四档字号,点一下即刻生效,全菜单与子面板同步。
  • 💡 自带用法提示:菜单底部(设置条上方)有一行小字双击来源标题可切换展开方式(当前:悬浮展开),新用户不必猜。
  • 🎨 配色与排版跟随官方:背景、文字、悬停、圆角全部复用官方 --dsw-* 主题变量,底色不透明、对比度充足;来源清单与子集清单尺寸与配色完全统一。
  • 🧩 纯 DOM 增强,零侵入:面板与设置条都是插件自建 DOM,选择通过程序化点击原菜单真实按钮完成,不移动、不删除任何 React 管理的节点,与其他插件兼容。
  • 🔒 不联网:插件没有任何网络请求,逻辑全在本地 DOM。

Features (v0.5.0, three modes)

  • 🖱 Hover to open (default) — glide over a source heading and its models slide out from the right; they retract when you leave. No click needed.
  • 📋 Sources first — the menu lists providers only (▾ arrow + name + model count).
  • 👁 Active source & model at a glance — the current source is tagged 当前·model-name (bold + brand colour), with ✓ on the selection inside the panel.
  • 🔄 Three modes, switchable — double-click any source heading to cycle hover → inline → panel, or use the in-menu switcher. Applied instantly and remembered.
  • 🔤 Font size right in the menu — pick 10 / 11 / 12 / 13; both the menu and the side panel follow.
  • 💡 Built-in hint — a one-line tip at the bottom of the menu (above the settings bar) tells new users about mode switching.
  • 🎨 Colours and type follow the host — background, text, hover and radius all come from the SAME --dsw-* tokens the official menu uses, with an enforced opaque background.
  • 🧩 Pure DOM enhancement, zero intrusion — the panel and the settings bar are plugin-owned DOM; selection happens by programmatically clicking the real menu buttons; no React-managed node is moved or removed.
  • 🔒 No network access — zero requests, all logic runs locally in the DOM.

适配内核 / Compatibility

项目 · 版本

DSH 桌面端(内核,实测) · 2.0.18-next(dsh-desktop-next)

官方模型选择组件(实测) · @deepseek-ai/dsh-client-ui-model-selection 0.2.1-alpha.2

客户端运行环境 · DSH Web GUI(Electron renderer,dsh-app://app/)

engines.dsh(本包声明) · >=0.1.7-rc.1

上表「实测」两行是本机 2026-10-19 从 app.asar 读出的真实版本,只作参考;本包自身只声明
engines.dsh: ">=0.1.7-rc.1" 与 peerDependencies["@deepseek-ai/dsh"]: ">=0.1.7-rc.1",
不硬绑某个具体内核版本。

本插件增强的是 两级下钻菜单(root → model / effort):

div[role="menu"]                      ← 官方 portal 到 body 的浮层
├─ pane="root"   button[role="menuitem"]      (「模型」「推理等级」两个 cell)
├─ pane="model"  div.groups > section[role="group"][aria-labelledby]
│                 ├─ div(分组标题 = 来源名)
│                 └─ button[role="menuitemradio"](模型项)
└─ pane="effort" 扁平的 button[role="menuitemradio"](无 section[role="group"])

插件只增强 pane="model";root 与 effort 因不含 section[role="group"] 而完全不介入——这也是「思考等级」面板一直稳定的原因。

若你的 DSH 内核版本不同:官方若改动 section[role="group"] / aria-labelledby / menuitemradio 这套语义结构,插件会因选择器失配而静默不生效(不会报错、不会破坏原菜单)。可在 DSH 里按 <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> 打开 DevTools,确认上述结构后再提 issue。

三种模式的交互细节见 [docs/modes.md](docs/modes.md),版本历史见 [CHANGELOG.md](CHANGELOG.md)。


安装 / Install

在 DSH profile 中安装(依赖 dsh.bundle 自声明,无需手动改 cordis.patch.yml):

dsh plugin --profile desktop add dsh-model-fold

或安装本地 tgz:

dsh plugin --profile desktop add ./dsh-model-fold-<version>.tgz

或把目录复制到 profile 的 node_modules 并在 profile package.json 的 dsh.profile.bundles 中加入 dsh-model-fold。

Install from npm:

dsh plugin --profile desktop add dsh-model-fold

回滚 / 模式说明 · Rollback

自 v0.5.0 起为三模式:默认 hover(划过来源标题就地滑出该来源的模型),双击任意来源标题按 悬浮 → 列表 → 面板 循环切换,也可用菜单底部设置条直接点选;选择写入 localStorage 并跨菜单记忆。panel(右侧子面板)是 v0.3.0~v0.4.x 的旧默认值,老用户首次升级会自动迁移到 hover,之后若再次显式选 panel 则尊重你的选择。若要回到 v0.2.0(单 inline 模式)版本,可从 GitHub Releases 获取历史版本。

Since v0.5.0 the plugin ships three modes: hover (default — glide over a source heading and its models slide out), with double-click cycling hover → inline → panel; the in-menu settings bar at the bottom lets you pick one directly. The choice is persisted across menu opens. panel was the default in v0.3.0–v0.4.x; users upgrading from that era are migrated to hover once, and any later explicit panel choice is respected. To return to the v0.2.0 single-mode behaviour, grab a historical release from GitHub Releases.


更新日志 / Changelog

v0.5.0

  • 🖱 新增悬浮模式并设为默认:鼠标划过来源标题就地滑出该来源的模型,移开自动收起(延迟 260ms 防闪烁)。三模式循环变为 悬浮 → 列表 → 面板。
  • 🎛 菜单底部新增设置条:可直接切模式、调字号(10 / 11 / 12 / 13),position: sticky; bottom: 0 常驻;按钮的 mousedown / click 都 stopPropagation,不会触发宿主「点外部关闭」。
  • 💡 新增用法提示行:菜单底部显示 双击来源标题可切换展开方式(当前:悬浮展开)。
  • 🔁 默认值迁移:老用户 localStorage 里的旧默认 panel 一次性迁移到 hover,之后显

…(truncated)

以上内容来自 npm 上的 README,我们只做格式化,不改内容。

版本

npm 上共发布:9,最后更新 2026-10-19

链接

GitHub · Homepage · npm

同类插件