Codex-style workflow auto-collapse: finished turns fold into a single "processed in Xs" row leaving only the final answer; tool calls and think blocks collapse into live-summary chips that follow streaming; expand level by level, fully reversible on uninstall.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:a179-sanae/dsh-auto-collapse
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
A DeepSeek Harness Web client plugin that auto-collapses tool cards and Think blocks into one-line summaries, so the chat keeps only what the model says.
中文: README.md
What it does
dsh-auto-collapse is a pure front-end DOM plugin for the DeepSeek Harness Web chat UI. It collapses the working process into one-line summaries — tool calls and reasoning no longer fill the screen, giving the chat the collapsible look of the VSCode Codex desktop client, and it also rewrites “Deep diving” to “Deep sleeping”. It never modifies message content — it only controls visibility of the working process:
- Turn-level auto collapse: when a turn finishes, the whole working process collapses into a
已处理 X秒(processed in Xs) row, leaving only the model's final text. Click to expand the full workflow (context injections → thinking → tool calls → intermediate text → final text). - Second-level rows: after expanding level one, tool-call groups and think blocks each collapse into a single chip row (
正在运行 {command}/运行了命令/已思考). Adjacent tool groups merge; body text is a hard boundary (never merged across). - Third-level think merge: expanding
已思考shows the consecutive think rows merged into one row titledThink · first line, click to reveal the merged content block. Raw fourth-level rows never appear. - Native visual alignment: 16px icon box / 14px glyph / 24px line height / 16px row gap; colors use DSH native tokens (
--dsw-alias-label-*); think and command icons come from DSH native icons (IconThinkOutline14/IconApiOutline14). - Stream-friendly: think summaries update without MutationObserver feedback loops; running animation is scale/opacity only (no layout participation); animations stop under
prefers-reduced-motion. - Fully reversible: uninstalling (HMR stop) restores every collapsed/hidden/rewritten node.
Install
dsh plugin --profile web add "github:a179-sanae/dsh-auto-collapse#main"
Restart the DSH web service (or trigger plugin HMR), then hard-refresh the page (Ctrl+Shift+R). No configuration needed.
Development
Project layout
src/fold.ts core: FoldController (state machine) + findBlocks (block recognition) + collapse/expand logic
src/client.ts browser entry (plugin registration)
src/index.ts host half
build.mjs esbuild build (the client registration id lives in the banner)
deploy.mjs quick deploy: build → overwrite installed copy → restart service → verify
cordis.patch.yml profile tree mounting
Quick deploy (local dev)
npm run deploy
Builds, overwrites the locally installed copy, restarts the service and verifies the served bundle. Path constants live at the top of deploy.mjs — adjust per machine; not applicable without a local DSH install.
Publishing a new version
npm pack --pack-destination <local-plugin-dir> # packing auto-triggers the build via the prepack hook
Point the plugin dependency in the profile's package.json to the new tarball and reinstall the plugin.
Key mechanisms
- Block recognition (
findBlocks): top-level message elements are classified as tool piles / pure-think messages / body-text messages; body text is a hard boundary —Think1-body-Think2carries Think2 as a leftover row absorbed by the next pile, or by its host message's block at the end of the flow so no stray think row survives a finished turn. - Turn collapse:
turn-tail/ new user message / steering are turn boundaries; on completion only the host that actually contains final body text stays visible — body-less tool/think hosts are hidden entirely (removes the blank gap between已处理and the final text). - Duration: streaming turns time from
turnStartMs; historical turns difftimeStart(turn start) against the turn-tail (end); formatsX秒/X分Y秒, whole minutes drop the seconds (15分00秒→15分), hour-levelX小时/X小时Y分. - React coexistence: block/row references are refreshed every pass; click handlers work through per-pass block bindings (no cross-pass closure references); plugin nodes removed by React re-renders are self-healed.
License
MIT
Links
More in this category
zhu1090093659/dsh-web-ui#packages/dsh-web-ui-all★ 2314
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 1071
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
omdsh-dev/DSH-better-sidebar★ 945
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-at-file★ 175
Codex-style `@file` mentions: search workspace files in the composer and attach their contents to prompts.
huiliyi37/dsh-tianshu-tui★ 143
A terminal UI (TUI) for DeepSeek Harness.
Nagi-ovo/dsh-visualize★ 95
In-conversation generative UI: the model renders interactive HTML cards into the chat stream, with streaming preview and sandboxed rendering.