In the default Web UI of DeepSeek Harness (DSH), each assistant reply renders reasoning (Think lines) and tool calls as separate collapsible lines. This creates many nested collapsible items in the conversation flow, which can look visually fragmented. The dsh-turn-collapse plugin imitates the Codex style by grouping reasoning and tool calls between visible outputs into a single collapsible unit, making the conversation flow clearer.
Plugin Overview¶
This is a purely client-side plugin maintained by mctang985211-coder, designed to simplify the conversation flow in the DSH Web UI by collapsing chain-of-thought and tool calls between visible text outputs. It reuses DSH design tokens to ensure visual consistency with the native UI.
Core Features¶
- Codex-style hierarchical collapsing: Groups reasoning and tool calls between visible outputs.
- Unified collapse bars: Inserts a collapse bar between each pair of visible outputs.
- Collapsed by default: Collapse bars are collapsed by default; click the triangle to expand them.
- State persistence: Collapse/expand states are persisted per session in
localStorage. - Design token reuse: Visual styles reuse DSH design tokens (
--dsw-alias-*).
Installation and Enabling¶
The plugin is installed via a local path link. Clone the repository first, then run the install command.
git clone https://github.com/mctang985211-coder/dsh-turn-collapse
cd dsh-turn-collapse
dsh plugin --profile web add link:$(pwd)
After installation, you must hard-refresh the browser for the plugin to take effect.
Usage¶
After enabling the plugin, the UI structure within the conversation flow changes. All reasoning (Think lines) and tool calls (ToolRow) between each visible output (text content) and the next visible output are wrapped in a collapse bar.
A schematic view is shown below:
[▶ 思考与工具 · 5 项] ← 折叠条:两段实际输出之间的一切(思考 + 工具调用)
文字输出 1
[▶ 思考与工具 · 3 项]
文字输出 2
- Expand/collapse: Click the triangle icon on a collapse bar to expand or collapse the group.
- Internal availability: In the expanded state, the native
Thinklines andToolRowitems inside remain collapsible and interactive as before.
Technical Details¶
- Client-side-only implementation: The plugin contains no host-side code, no server, and no API surface.
- Rendering handling: Uses
MutationObserverto watch the conversation scroll container ([data-conversation-scroll]) and performs a reconcile pass to handle React re-renders. - Data source: Flow node types are identified by
data-chat-flow-kind(e.g.,assistant-step,tool-call), and reasoning lines are located bydata-variant="think".
Scope and Notes¶
- Use case: Suitable for agent developers who want a Codex-like experience in the DSH Web UI and want to reduce visual clutter.
- Permissions and security: Because it is a purely client-side plugin running inside the browser sandbox of the current dsh process, you do not need to worry about backend permission leakage. However, it is recommended to review the source code and license (MIT) before installation.
- Notes: The plugin depends on DSH design tokens and DOM structure, so compatibility may need to be rechecked after upgrading the DSH version.
Summary¶
dsh-turn-collapse solves the problem of too many collapsible elements in the default DSH output stream with simple collapse logic. It maintains state via localStorage and remains stable across React re-renders, making it a practical tool for improving Web UI readability.