Preface¶
When pasting logs, configuration snippets, or long explanations into DSH (DeepSeek Harness), the input box and chat history can easily become flooded with large blocks of text, making them hard to read or review. The common workaround—manual trimming or splitting messages—is tedious and prone to losing content. dsh-collapse-paste, described below, is a purely client-side UI plugin published by maintainer Mrsong123456. It collapses multi-line pastes that reach a threshold in the input box, as well as already-sent long user messages, into compact inline chips. Content sent to the model is always the full original text; nothing is truncated or rewritten.
What This Is¶
dsh-collapse-paste is categorized as a DSH client-side plugin. The current npm package version is 0.2.4, licensed under MIT. It enhances the display of the input area and message area within the browser page without altering DSH’s core sending logic. Collapsing affects display only; storage and the text submitted to the model remain identical to native paste and native send. The plugin is discoverable via the SkillHub directory, with source code and documentation at GitHub: Mrsong123456/dsh-collapse-paste.
Core Features¶
Input Box: Collapse Multi-line Paste into a Chip¶
- When pasted plain text reaches a threshold (default: ≥ 3 lines), the entire block is collapsed in the input box into an inline chip labeled like
X chars / Y lines. - The chip’s style aligns with DSH’s native
@filereference chip (22px, same token styling, ellipsis). Pressing Backspace atomically removes the entire collapsed block. - Clicking the chip expands the original text; clicking again collapses it.
- The full text is automatically restored on send. The model receives the same content as a normal paste without the plugin.
Message Area: Collapse Sent Long Messages¶
- If a sent user message reaches a threshold (default: 600 characters or 12 lines—collapsing occurs if either is met), a blue chip appears on the right:
X chars / Y lines · click to expand. - Click to expand in place; a separate “click to collapse” link appears at the end of the message—no need to scroll back to the top.
- Collapsing hides the body only. The timestamp and the action bar (copy, edit, delete, etc.) remain available. Stored content is unchanged. Assistant replies are unaffected.
Failure Strategy and Compatibility¶
The plugin relies on DSH 0.2.1-era Lexical internal interfaces (e.g., __lexicalEditor, _nodes, text-leaf styling) and the message area DOM (data-chat-flow-kind, userStack, etc.). If the current environment does not match, it will fail open (fall back to native behavior) and will not block DSH startup.
| Environment | Status |
|---|---|
| DSH Desktop 0.2.1-rc.2 | Manually verified on Windows desktop |
| DSH Web (same version) | Not separately verified; expected to behave the same |
| DSH ≤ 0.2.0 / ≥ 0.3 | Not verified; may not work |
In package.json, engines.dsh requires >=0.2.1-rc.2.
Installation and Activation¶
The simplest method is to install via npm with a single command (no local build required):
dsh plugin --profile desktop add dsh-collapse-paste
pnpm 11 has a default publish-age protection of about 24 hours. Shortly after a release, installing without a version number may still resolve to the previous version. To install a specific version immediately:
dsh plugin --profile desktop add dsh-collapse-paste@0.2.4
You can also install from GitHub (the repository includes the prebuilt lib/):
dsh plugin --profile desktop add github:Mrsong123456/dsh-collapse-paste
After installation, restart DSH (restart the desktop app; restart dsh web for the web version). To uninstall:
dsh plugin --profile desktop remove dsh-collapse-paste
Configuration¶
Open Settings → Collapse Multi-line Paste within DSH (near the bottom of the Settings sidebar).
| Field | Default | Description |
|---|---|---|
| Enable input box collapsing | On | When off, the current draft expands immediately; subsequent pastes remain native |
| Input box: minimum lines | 3 | Paste must have at least this many lines to collapse |
| Input box: minimum characters | 0 | Additional character threshold; 0 means only line count matters |
| Collapse long messages after send | On | When off, the message area immediately reverts to full display |
| Message collapsing: minimum characters | 600 | Collapses if either characters or lines threshold is met |
| Message collapsing: minimum lines | 12 | Collapses if either characters or lines threshold is met |
Settings are stored in the current browser’s localStorage (key: dsh-collapse-paste.config.v1), applied immediately after saving with no restart required. Settings are not synced across browsers or devices.
Typical Usage¶
No additional commands are needed; after installing and restarting:
- Ctrl+V to paste multi-line text into the input box (with defaults, a
chars / lineschip appears once 3 lines are reached), and the draft area will no longer expand to show the full text. - When you need to review the content, click the chip to expand. After editing or confirming, send as usual; on the model side, the content is still the full original text.
- After sending an oversized user message, expand/collapse it in the chat history via the blue chip on the right; a “click to collapse” link at the bottom helps with reading long messages.
- If you want input-box collapsing only and do not want to collapse historical messages, turn off “Collapse long messages after send” in Settings.
Privacy, Permissions, and Usage Notes¶
The plugin runs within the DSH page, listens for the global paste event (reads clipboard plain text only; does not intercept file pastes), and uses a MutationObserver to watch the input box and chat DOM for counting and collapsing. Thresholds are written to local localStorage. It makes no network requests and does not collect or upload data.
DSH plugins run with the permissions of the current DSH process. Before installing third-party plugins, review the source code and license yourself (this plugin is MIT). SkillHub and similar sites are community directory sites and are not officially affiliated with DeepSeek or HF (Huanshui).
Known limitations (from the README): Lexical internals may change with DSH upgrades; if it breaks, the plugin silently falls back to native behavior. Expand/collapse state exists only in the current page memory; after refresh, it returns to default collapsed state. Message-area collapsing is purely a display-layer behavior; when virtual scrolling rebuilds rows, collapsing is reapplied. Settings do not sync across devices with the DSH profile.
Acknowledgment for the input-box collapsing approach to @comecaramelos/dsh-collapse-multiline-paste (Robe ComeCaramelos, MIT): the text remains in a TextNode, and the chip does not contribute submitted text, so the draft and native paste are byte-for-byte identical.
Closing¶
dsh-collapse-paste is designed for users who frequently paste logs, document blocks, or send long prompts in DSH: the interface is more compact, while sending and storage still use the full text. Directory page: SkillHub - dsh-collapse-paste; repository and full documentation: GitHub - Mrsong123456/dsh-collapse-paste.