Skip to content
dsh.fish
Bundle

dsh-collapsible-models

DSH client plugin: collapsible model-provider groups in the composer model picker — click a provider row to fold or unfold its models

Source
ZhenXifu
stars
1 stars
License
MIT
Updated
Updated yesterday

Readme

# dsh-collapsible-models

A [DeepSeek Harness](https://github.com/deepseek-ai/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.

[中文说明](README.zh.md)

## 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

```sh
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:

```sh
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:

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

## License

MIT

Install

dsh plugin --profile web add github:ZhenXifu/dsh-collapsible-models#4fe7154f27c053c30ed9dffcad30de13e0391405

Profile: web

Source