dsh-collapsible-models
其他 活跃维护

dsh-collapsible-models

ZhenXifu/dsh-collapsible-models

Composer模型选择器客户端插件,为模型提供商分组添加折叠能力,减少选择时的视觉冗余,避免选项过多导致的查找困难,优化模型调用交互体验。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
16 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:ZhenXifu/dsh-collapsible-models
git clone https://github.com/ZhenXifu/dsh-collapsible-models.git
git clone git@github.com:ZhenXifu/dsh-collapsible-models.git
README.md main

dsh-collapsible-models

A DeepSeek Harness client plugin that makes the
model-provider groups in the composer model picker collapsible.

Click any provider row in the model dropdown to fold or unfold its models —
a small triangle next to the provider name rotates to show the state. Useful
when you have many providers configured and want a short, focused model list.

中文说明

How it works

  • The composer's model seat is the single slot conversation.input.model,
    occupied by the shipped client-ui-model-selection plugin (priority 0).
  • This plugin registers a shadow entry at priority: -1. Slot entries are
    ordered by ascending priority and the lowest renders, so the collapsible
    variant takes over the seat while the shipped UI stays registered underneath.
  • The data layer is untouched. The per-session model directory (catalog,
    current selection, load/select verbs) comes from the shipped
    modelDirectories cordis service, so selections, reasoning-effort handling,
    loading states, failures, and toasts behave exactly like the stock picker.
  • If the shipped model picker is absent (a harness without
    client-ui-model-selection), the plugin loads but registers nothing — the
    default UI stays as-is.

Install

dsh plugin add dsh-collapsible-models

or in DSH Desktop, through the Community Market (the package carries the
bundle patch the managed installer verifies). Restart the harness after
installing; the new seat takes effect in the next client generation.

Remove it the same way:

dsh plugin remove dsh-collapsible-models

Behavior notes

  • All provider groups start expanded (matching the stock UI). Collapse
    state is per dropdown open-session and intentionally not persisted.
  • The aria-expanded state and per-group accessible labels follow the active
    locale (zh/en).
  • Keyboard navigation of the model list is unchanged; the group header is a
    real <button>, so it is focusable and toggleable with the keyboard.

Development

The plugin is hand-written in the lazy-CJS client bundle protocol
(window.__ModuleLoader__.load) — no build step. The two halves:

  • dsh/index.js — host half (no-op; makes the package appear in the host
    Cordis graph via cordis.patch.yml).
  • dsh/client.js — browser half (the collapsible ModelSelect shadow).

To try it locally without publishing:

dsh plugin add <path-or-url-to-this-repo>

License

MIT