- Home
- Plugins
- Sessions & Messages
- dsh-turn-hider
dsh-turn-hider
amd47802574/dsh-turn-hider
Hide any single chat turn (user message, assistant reply and tool activity) from the transcript view; display-only, session logs stay untouched, with a restore panel.
Install
dsh plugin --profile web add github:amd47802574/dsh-turn-hiderREADME
dsh-turn-hider
Hide any single chat turn from the DeepSeek Harness (DSH) transcript — display only.
One click on the trash icon at the end of a message's icon row, and that whole turn (user message + assistant reply + tool activity + usage line) disappears from the conversation view. Nothing else changes: session logs, projection caches, the full-text search index and the model's context are never touched. Every hidden turn can be restored at any time.
为什么做这个 / 中文说明见 README.zh.md
✨ Features
- 🗑 One-click turn hiding — a trash button is injected at the tail of every message's built-in icon row (copy / like / dislike / summary / share / time). Clicking it hides that entire turn from the transcript.
- ↩️ Non-destructive by design — display-layer only. The session's
session.v4.jsonl.zstdlog, projection cache and search index stay exactly as they were; the model still sees the hidden content in later turns. - 🧠 Per-turn memory — hidden turns are recorded as (session id, turn number)
pairs in browser
localStorage. They survive page reloads, app restarts and re-entry into the session, and are scoped per session. - 🧩 Restore anywhere, anytime — a floating badge ("已隐藏 N 轮") opens a management panel listing every hidden turn with a text preview, with per-turn Restore and Restore all buttons. A toast with Undo appears right after each hide.
- 🎨 Theme aware — the panel, badge and toast use DSH theme tokens
(
--dsw-alias-*), so light/dark themes are followed automatically. - 🔌 Zero backend — the host half is a mount anchor only. No routes, no file system access, no data leaves the browser.
📦 Installation
Option A — local folder (Desktop)
- Clone or download this repo to a stable path, e.g.
F:/desktop/草稿文件/dsh产物/dsh-turn-hider; - Edit
~/.dsh/profiles/desktop/package.json:- add to
dependencies:"dsh-turn-hider": "file:F:/desktop/草稿文件/dsh产物/dsh-turn-hider" - add to
dsh.profile.bundles:"dsh-turn-hider"
- add to
- Run
pnpm installinside the profile directory (or simply create a junction:mklink /J "%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-turn-hider" "<this folder>"); - Restart the DSH desktop app.
Option B — from GitHub (Desktop / Web profile)
dsh plugin add github:amd47802574/dsh-turn-hider
or install it from any plugin manager that reads GitHub sources, then restart.
Option C — plugin marketplace
A PR to the DSH plugin marketplace is planned; once merged, the plugin appears in the in-app store search.
🕹 Usage
- Open any session in the DSH web UI;
- Hover a message: its icon row shows
copy 👍 👎 summary share 🗑 22:53— the trash sits right before the clock; - Click 🗑 → the whole turn (user message + reply + tool process) vanishes and a toast with 撤销 / Undo appears for 6 seconds;
- Click the badge at the bottom-right (已隐藏 N 轮) to open the panel:
- each row shows the turn number + first line preview + a 恢复 / Restore button;
- 全部恢复 / Restore all clears the session's hidden list at once.
⚙️ How it works
chat flow rows (seats)
├─ user message row (icon row clock="start") ─┐
├─ tool process group (data-chat-turn="N") ├─ turn block N
├─ assistant reply row (icon row clock="end") ─┘
└─ turn tail / usage (data-turn-tail="N")
- Turn blocks are anchored on user messages: one block = one user message plus every flow row before the next user message. Block boundaries therefore only depend on the user-message sequence, which is stable across reloads and paging.
- Block → turn number resolution order: direct markers on the row
(
data-chat-turn/data-turn-tail/data-turn-process) → React fiber props (routedNode.location.turn.turn, or aturnprop) → ordinal count of user messages. - Hiding sets
data-dth-hidden="1"on every row of the block; a single CSS rule (display:none !important) collapses it. A debouncedMutationObserverre-applies the state whenever React re-renders or history pages in. - Trash button injection clones the row's own action button (identical class names, size and color) and swaps in a trash glyph, so it always matches the active theme; if React removes it during reconciliation, the next scan re-adds it.
- Persistence lives in
localStorage["dsh-turn-hider:hidden:v1"]keyed by session id.
❓ FAQ
Does the model still see hidden turns? Yes. This is a display-layer tool; the next request still carries the hidden content. Use it to declutter your view, not to erase context.
Is anything deleted? No. Logs, caches, indexes and session state are untouched. Hiding is reversible and local to your browser profile.
Does it sync across browsers/devices? No — the hidden list is per browser (localStorage). Different windows of the same browser share it.
Does hiding survive app restarts? Yes, as long as the same browser profile is used.
🧯 Troubleshooting
| Symptom | Fix |
|---|---|
| No trash button on icon rows | Restart DSH after installing; the bundle loads at startup |
| Click does nothing | Update to ≥ 0.1.1 (user-message-anchored blocks) and restart |
| Badge missing | You are not inside a session view; open a conversation first |
| A turn comes back after scrolling | History re-paged in; the observer re-hides it within ~100 ms |
🧹 Uninstall
Remove dsh-turn-hider from dsh.profile.bundles and dependencies (or
uninstall via the plugin manager), then restart. To wipe the hidden list, clear
the dsh-turn-hider:hidden:v1 key from localStorage.
🤝 Compatibility
| Host | Status |
|---|---|
| DSH Desktop (Electron web UI) 0.2.x | ✅ tested |
DSH Web profile (dsh web) | expected to work (same client runtime) |
| Chat themes | tokens-based, follows light/dark |
🗺 Roadmap
- Marketplace submission (PR to the plugin index)
- Optional: hide-from-context toggle with explicit warning
- Multi-select hiding from the panel
🧑💻 Development
No build step: client.js is hand-written in the official client-bundle shape
(window.__ModuleLoader__.load({ id, factory })), host.js is a no-op cordis
service. node --check client.js is the only validation needed.
dsh-turn-hider/
├── client.js # browser half: scan, hide, inject, panel, storage
├── host.js # cordis mount anchor (no-op)
├── cordis.patch.yml # bundle patch: insert the anchor service
├── package.json # dsh.bundle.patch + dsh.client declarations
└── icon.svg
PRs welcome — keep the display-only guarantee: never touch session data.
📄 License
MIT © amd47802574
Related plugins
billion-context
ranxianglei/billion-context
dsh-web-ui (dsh-chat-recovery)
zhu1090093659/dsh-web-ui
dsh-synapse
liangmianya/dsh-synapse
dsh-archive-manager
michengai/dsh-archive-manager