Folds long user messages in chat to a fixed height and adds a small chevron in the bubble's bottom-right corner to expand or collapse them. Display only, the model still receives the full text.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:nuscior/dsh-long-message-fold
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DeepSeek Harness 插件:对话里过长的用户消息自动折叠成固定高度,气泡右下角出现一个小箭头,点一下展开全文,再点收起。
只改显示。模型收到的仍然是完整原文,上下文、token 数、导出记录都不受影响。
行为
- 可见字符数达到 600 才开始折叠,短消息完全不受影响(阈值写死在
client.js的MIN_CHARS)。 - 折叠后高度限制为 320px,约十到十二行正文(
CLAMP_PX)。 - 箭头绘制在气泡右下角,跟随气泡流式增长重新定位;有
aria-label和aria-expanded,键盘可操作。 - 中英文文案跟随宿主语言;拿不到 locale 时回退中文。
安装
DSH 0.2.2-rc.1 及以上。
插件市场:在 插件 → 插件市场 里搜索
dsh-long-message-fold。发现(索引源):添加本项目所在的索引源,再点安装。
手动:在 profile 目录执行
dsh plugin --profile <profile> add github:nuscior/dsh-long-message-fold
装完在 插件 → 已安装 里确认出现「长消息折叠」,然后开新会话生效。
兼容性
- 在 DSH 0.2.2-rc.5(Desktop,profile
desktop)上验证。 - 包内声明
engines.dsh: ">=0.2.2-rc.1";更早的版本未测试,安装时会被拦下。 - 纯 Client 模块,无 Node 依赖、无构建脚本、无网络请求。
实现方式
Host 半部分是空的(index.js 只有 export function apply() {}),渲染全在 Client 模块:
- 通过
ctx.slots.inject('conversation.chat.user.before')注册到每条用户消息前的插槽,只对owner.kind === 'user'的行渲染。 - 用
MutationObserver+ResizeObserver找到同一行里的[data-message-bubble],给它加data-ltf-collapsed属性,CSS 靠这个属性做max-height截断,不替换、不改写宿主渲染出来的 DOM 结构。 - 卸载时移除属性、移除注入的
<style>、恢复被临时设成position: relative的行。
已知限制
- 依赖宿主把消息气泡标记为
[data-message-bubble]。DSH 大版本改动这层结构后可能失效,届时需要跟着更新。 - 同时修改消息气泡的其它插件理论上可能互相干扰(都在这层 DOM 上做标记)。
- 折叠高度和字符阈值目前不可配置,改的话在
client.js顶部两个常量。
License
MIT,见 LICENSE。
English
A DeepSeek Harness plugin that collapses long user messages in chat to a fixed height and adds a small chevron in the bubble's bottom-right corner to expand or collapse them.
Display only — the model still receives the whole message, and nothing about the stored transcript changes.
- Folds only when the visible text reaches 600 characters; collapsed height is 320px.
- Renders through the
conversation.chat.user.beforeslot and tags the shipped[data-message-bubble]element withdata-ltf-collapsed; the host's DOM structure is not replaced. - Client-only: no Node dependencies, no build step, no network access.
- Verified on DSH
0.2.2-rc.5;engines.dshis>=0.2.2-rc.1.
Install from the plugin market, from an index source, or with dsh plugin --profile <profile> add github:nuscior/dsh-long-message-fold.
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10715
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10715
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8617
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7532
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5410
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1099
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.