Pular para o conteúdo principal
Y

dsh-workspace-improve

yyx-123/dsh-workspace-improve

Refines the DSH sidebar with workspace typography, configurable completed and running Session styles, an expand-all control, and persistent deferred Session markers.

Instalar

dsh plugin --profile web add github:yyx-123/dsh-workspace-improve

README

Workspace and Session presentation

中文说明见 README.zh.md.

A DSH plugin that only improves how the existing sidebar presents workspaces and Sessions. It keeps the native workspace list and the native collapse behavior: there is no workspace grouping, no group management, and no group-level collapsing.

Install

Search for dsh-workspace-improve under Plugins → Add plugin, or run:

dsh plugin add dsh-workspace-improve

The plugin has no build step. If DSH reports an incompatibility after a host upgrade, update the plugin.

Presentation

  • Workspace titles use 15px / 600, clearly separated from the weight of a regular Session title.
  • Completed Sessions the user has not looked at yet get the theme success color, slightly bolder.
  • Running Sessions show a continuously moving underline; when the system asks for reduced motion it becomes a static underline.
  • Right-click any Session and choose 稍后处理 (mark as pending) to show an amber ◷ marker at the trailing edge of the row; choose 处理完成 (done) to clear it. The marker is persisted, and the menu entry renders the same clock glyph as the row.

Preferences

Settings gains a 工作区展示 / Workspace presentation section that adjusts the effects above:

  • Completed color: five theme presets (success green, brand blue, business purple, warning orange, neutral gray) or any color through the last swatch. Presets reference theme variables, so they keep their meaning across themes and light/dark mode; only a custom color is stored as a fixed hex value.
  • Completed weight: turn it off and finished Session titles change color only.
  • Running animation: turn it off and running titles use a static underline instead of the moving one, and the ring on a folded workspace stops spinning.
  • Reset: restore the success color, bold weight and animation in one click.

Changes take effect immediately and are written to browser localStorage under dsh-workspace-improve:prefs. They never travel through the Host and need no restart. If storage is disabled or full, the values still apply for the current session.

Status of a collapsed workspace

When a workspace is collapsed with the native control, the plugin shows status markers next to its title:

  • Green dot: the workspace holds a completed Session that has not been viewed yet.
  • Amber ◷: the workspace holds a Session marked as pending.
  • Spinning ring: the workspace holds a running Session.

The markers can appear together and are hidden while the workspace is expanded. The plugin subscribes to the public uiSession.sessionStatus, the Workspace/Session lists and the persisted marker state, so the indicators update as runs finish, completion-unread appears, or a marker is cleared.

Only Sessions that the sidebar actually renders as rows are counted. Subagent Sessions (origin: 'subagent') have no row of their own and their completion-unread flag is never cleared by a row, so they are excluded; archived, blank draft, and waiting-for-interaction Sessions do not produce markers either.

Expand / collapse all workspaces

A button between the block title and the inline search field:

  • While any workspace is collapsed, it shows a down chevron with the tooltip 展开全部工作区 (expand all) and clicks each collapsed row open.
  • When every workspace is expanded, it shows an up chevron with the tooltip 收起全部工作区 (collapse all) and clicks each row closed.

The button keeps no second copy of the expansion state: it clicks the native workspace rows, and the built-in view store remains the source of truth. It re-checks every frame until all rows converge, because collapsed rows mount their child Sessions lazily and one click is not always enough. The button hides itself while the search field is open or the sidebar is in the narrow rail layout, and it re-syncs after theme or language changes and list re-renders.

Compatibility

Supported DSH versions: 0.2.2-rc.5 and later 0.2.x releases (< 0.3.0).

The plugin does not replace sidebar, sidebar.workspaces or any built-in child slot, and it adds no workspace-group settings page, group menu, ordering or group-collapse event. The native workspace search, directory picker, workspace/Session menus, Session row extensions and hover cards keep rendering through DSH itself.

Collapsed status markers are pure CSS generated for the existing [data-row-key="workspace:…"][aria-expanded="false"] rows; they do not take over clicks, drag or keyboard input. The one place that touches the DOM directly is the header button, because DSH exposes no slot for the workspace block header: it is inserted inside [data-sidebar-workspace-header] before the built-in search field, and a MutationObserver follows re-renders while ignoring changes inside its own subtree; unmounting removes it together with the stylesheet. Session markers use the additive sidebar.session.row.trailing slot and the menu is added through the public Context Menu API. Colors use only current DSH theme variables, so the plugin works alongside theme plugins.

Persistence and safety

Only the "pending" Session markers are written by the Host-side workspaceImprove Remote Service into the DSH JSON KV store, unit workspace_improve, data version 2. Legacy grouping data is migrated lazily: Session markers are preserved, while groups, assignments and collapse state are no longer read or restored; the new format is written on the next save.

An unknown data version or a corrupted root state refuses to load and is never silently cleared. The plugin never deletes workspaces, directories or Sessions, and never reorders workspaces. Disabling the plugin removes its menu, slots, subscriptions and styles.

Local checks

npm install
npm run check
npm test

There is no build step. When developing through a source link, the devDependencies let the plugin resolve the Host peer modules from the source directory; a normal install uses the peers provided by DSH. The plugin's own zod is pinned to 4.6.6.

Plugins relacionados