Introduction

In DSH, the model selector expands all providers by default. When many models are available, this takes up a lot of vertical space. dsh-model-collapse solves this by collapsing the list into provider-organized groups, and with the quick bar and keyboard shortcuts, you can quickly locate the target model.

Plugin Introduction

This is a DSH web plugin. It groups and collapses the model selection dropdown by provider, defaults to all collapsed, and expands when clicking the title. A persistent quick bar at the top provides expand/collapse/focus/reset/filter functions. The plugin is maintained by GoldenZqqq and licensed under MIT.

Core Features

  1. Grouped Collapsing: The model list is grouped by provider and collapsed by default. Click a group title to toggle expand/collapse state; a badge beside the title shows the model count.
  2. Top Quick Bar: A toolbar is permanently displayed at the top of the menu, including expand, collapse, focus current, reset memory, filter, and other functions.
  3. Keyboard Shortcuts:
    - Alt+E: Expand all groups with one key.
    - Alt+C: Collapse all groups with one key.
    - Alt+F: Focus the filter box and select all existing content.
  4. Memory Function: Expansion state is saved based on browser localStorage (key name: dsh-model-collapse:expanded-v1) and persists after next menu open or DSH restart.
  5. Pure Front-end Enhancement: Only uses data-* attributes and <style> rules to implement DOM collapsing; does not modify the official DSH package and does not fork the source code.

Installation and Enablement

Use the official install command to add the plugin:

dsh plugin --profile web add GoldenZqqq/dsh-model-collapse

After installation, restart DSH web and refresh the page to take effect.

Configuration

In the cordis.patch.yml file, find the corresponding line and modify config:

- insert:
    - id: model-collapse
      name: dsh-model-collapse
      config:
        enabled: true              # 总开关,false 即停用
        expandSelectedGroup: true  # 首次打开时是否默认展开"当前选中模型"所在分组
        quickBar: true             # 是否显示顶部快捷条
        accordion: false           # 手风琴模式:展开某组时自动收起其他组

Usage

  1. Expand/Collapse: Click a group title or use the shortcut Alt+E / Alt+C.
  2. Focus Current: Click “Focus” on the quick bar or use Alt+F (only the group containing the currently selected model is expanded).
  3. Filter Models: Enter a keyword in the quick bar filter box. Matching groups automatically expand; non-matching groups are hidden entirely, with the badge showing hit/total.
  4. Reset Memory: Click the ↺ icon on the quick bar, or run localStorage.removeItem('dsh-model-collapse:expanded-v1') and refresh.

Notes

  • Repository Archive: This repository is archived. For future updates, see the collection repository GoldenZqqq/dsh-plugins.
  • Technical Implementation: The plugin relies on the ARIA semantics (section[role="group"]) of nodes rendered by React, without modifying the official package.
  • Permission Scope: The plugin runs within the current DSH process permissions and only performs browser-side DOM enhancement.

Conclusion

dsh-model-collapse solves the issue of an overly long model selector through collapsing and grouping, suitable for scenarios that require frequent switching between models from different providers. For more details, see the GitHub repository.