Skip to content

dsh-ui-conversation-folded

Verified

@khalilhsu/dsh-ui-conversation-folded ยท v0.1.2 ยท MIT ยท Web UI

Fork of the conversation domain with per-turn folding: each round's assistant activity (CoT + tool calls) is bounded to a max-height scroll container with collapse and streaming auto-scroll. UI-only.

Install

dsh plugin add @khalilhsu/dsh-ui-conversation-folded

Confirm the layer applied with dsh --profile default --dump-config โ€” see the install guide.

Source

Published to npm without a public repository. Inspect the package contents before installing.

Creators

Readme

@khalilhsu/dsh-ui-conversation-folded

npm version License: MIT

UI-only fork of @deepseek-ai/dsh-client-ui-conversation for DeepSeek Harness. Folds each round's assistant activity โ€” intermediate CoT ("Think" rows), tool calls, and in-between narration โ€” into a bounded, scrollable container per turn.


๐Ÿš€ Installation & Uninstallation

1. Install (via npm)

# Add the plugin to your Harness web profile
dsh plugin --profile web add @khalilhsu/dsh-ui-conversation-folded

# Restart dsh web and refresh your browser
dsh web

2. Uninstall

dsh plugin --profile web remove @khalilhsu/dsh-ui-conversation-folded

โœจ Features & Behavior

Feature Description
Bounded Height Scroll area for intermediate actions is capped at --cot-fold-max-height (default 288px) with an internal scrollbar.
Fold & Unfold Slim clickable bar with ๆ”ถ่ตท / ๅฑ•ๅผ€ showing N tool calls ยท M thinking ยท duration.
Streaming Auto-Scroll Follows the newest tokens/tool outputs while running; scrolling up pauses follow, returning to bottom resumes it.
Auto-Collapse on Final Automatically collapses the fold once the final closing response begins streaming.
Questions Stay Visible ask_user_question rows are treated like the turn-tail: they render OUTSIDE the fold, so a pending "ๆ้—ฎยท็ญ‰ๅพ…ๅ›ž็ญ”" row is never hidden (or unmounted) by a collapsed fold.
Session Toggle Header button (ๆ€่€ƒๆŠ˜ๅ  / ๆ€่€ƒๅฑ•ๅผ€) turns the fold behavior on/off globally, saved in localStorage.
Full Interaction Preserved Inspecting tool calls, per-tool expansion, code copying, and markdown features work unchanged.

๐Ÿ—๏ธ Architecture: Why a replacement fork?

The chat flow in DSH is a keyed React list (order.map(nodeKey => <ChatNodeSeat/>)). Wrapping individual rows via DOM mutation plugins breaks React's reconciliation during paging, older message prepend, and compaction markers.

The fold is therefore implemented directly inside ChatView as a React-level turn grouping. This fork is registered via patch.yml to replace the default ui-conversation package seamlessly.

patch.yml            disables shipped ui-conversation, injects this fork
src/client/chat/
  ChatView.tsx       turn segmentation (slots: plain rows vs fold units)
  TurnFold.tsx       the fold: bar + capped scroller + running auto-scroll
  CotFoldToggle.tsx  session-header on/off switch
  fold-store.ts      preference state (useSyncExternalStore)
  ChatView.module.css

๐Ÿ› ๏ธ Build from Source

# 1. Symlink dependencies from a DeepSeek Harness checkout
ln -s /path/to/deepseek-harness/packages/client/ui-conversation/node_modules node_modules

# 2. Build client & host bundles
#    lightningcss is resolved dynamically (no hardcoded machine path): the
#    symlink above points into the checkout, so `npm run bundle` works as-is;
#    alternatively set DSH_ROOT=/path/to/deepseek-harness or run tsdown from
#    inside the checkout.
npm run bundle

# 3. Add local package to profile
dsh plugin --profile web add /path/to/ui-conversation-folded

License

MIT