DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

UNscientific-9 /

UNscientific-9/dsh-turnfold

Topic repository only

DSH Web 轮次折叠插件:thinking/工具调用流式可见,turn 完成后自动收纳成一行摘要。

★ 1 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@9aca3ce3

English | 中文

dsh-turnfold

License: MIT DSH Release TypeScript

An enhancement plugin for the official turn fold bar built into DSH Web 0.1.5 — it takes over the official turn-process renderer with an identical look and behaviour, and adds five enhancements the official bar doesn't have, purely client-side.

Effect demo

43 tool calls · 15 messages is the official count; the faded · took 30m 49s tail is injected by this plugin. Click to fold/unfold — your choice survives refreshes.


The five enhancements

Enhancement What it does
Duration + thinking segments Appends · took X · M thinking segments in a faded tertiary colour, computed by the plugin's own per-turn state machine
Fold-decision persistence The official fold state is in-memory only (lost on refresh); the plugin records your choice in localStorage and restores it on reload
completed whitelist (optional, off by default) The official bar folds every settled turn regardless of outcome; when enabled, aborted / errored / max-tokens turns stay expanded and render no bar at all
Auto-load earlier history Scrolling near the top of a conversation automatically invokes the official loadOlder(), so long-session history arrives pre-folded
Standalone fold bar When the official renderer finds no finalized answer (a turn stopped on a tool call — interrupted or errored), it renders no fold bar at all and leaves the whole turn flat. The plugin adds its own bar for such closed turns — expanded by default, collapsible, decision persisted like any other

Purely front-end: no backend changes, no session-store changes, zero server-side residue after uninstall. Pinned to DSH 0.1.5-rc.2 (official turn-process fold bar, keyed slot conversation.chat.node, useTurnData injection surface).


How it works

flowchart TB
    OFF["Official ui-chat fold bar<br>(turn-process)"]
    FOLD["FoldBarView<br>this plugin's shadow renderer"]
    DEF["turn-activity definition<br>per-turn state machine"]
    OFF -->|"shadow takeover"| FOLD
    FOLD -->|"official counts + augment<br>useTurnData('turn-activity')"| DEF
    DEF -.->|"published at turn/end"| DATA["{ durationMs, thinkingSteps,<br>reasonKind }"]

Takeover: ctx.slots.register({ key: 'turn-process', priority: -1 }) — the lowest priority renders among same-key registrations. Expanding runs a CSS height transition (no measurement, via interpolate-size); collapsing runs a Web Animations API height transition that folds the official geometry changes into the same batch — both reversible mid-flight and prefers-reduced-motion aware. When the official renderer finds no finalized answer it renders no bar at all; the plugin supplies its own standalone bar for those closed turns.


Install (4 steps)
  1. Get UNscientific-9-dsh-turnfold-0.5.0.tgz (see Releases) and put it in a fixed directory.

  2. Edit the DSH web profile's %USERPROFILE%\.dsh\profiles\web\package.json and add the dependency:

    {
      "dependencies": {
        "@UNscientific-9/dsh-turnfold": "file:D:/path/to/UNscientific-9-dsh-turnfold-0.5.0.tgz"
      }
    }
    
  3. In the profile directory, run pnpm install, then restart DSH web and hard-refresh the browser (Ctrl+Shift+R).

  4. The browser console should show [dsh.turnfold] v0.5.0 loaded, and completed turns get the official-style fold bar with a faded · took X · M thinking segments tail.

Requires DSH web 0.1.5-rc.2 (the fold bar shipped in the 0.1.2 line; this build is pinned to the 0.1.5 host API).

Configuration (localStorage)
Key Default Effect
dsh.turn-collapse.completedOnly unset Set to '1' to keep aborted / errored / max-tokens turns expanded; remove the key to restore the official behaviour
dsh.turn-collapse.autoLoad '1' Set to '0' to disable auto-load of earlier history
Uninstall / rollback

Remove the @UNscientific-9/dsh-turnfold line from the profile package.json, run pnpm install, restart DSH web and hard-refresh. Everything the plugin owns lives in the browser (three localStorage keys + one <style> tag); removing it restores the pure official fold bar.


Documentation

Full user guide · Architecture · Manual verification checklist

License

MIT

—/ 5

No ratings yet

Manifest verification required

Commit 9aca3ce37631

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout