rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:ayuanxx-max/dsh-session-accordion
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
30 秒理解:把 DSH 会话里每一轮对话折叠成一行(时间胶囊 + 问题摘要),只保留最新一条展开。纯客户端插件,不改核心。
兼容 DSH Desktop / Web;安装见下方「安装」,卸载见「卸载」。
📖 会话管理指南(折叠 + 分叉树组合用法) · Guide
下面是本次更新的功能清单,详细操作说明在正文里:中文见 功能与使用,English see Features and usage。
MM-DD HH:mm + 提问摘要),只保留最新一轮展开。Enter 跳下一个命中,Esc 关闭并完整还原。📌,一眼分辨。今天 / 昨天 / MM-DD),鼠标停在折叠行上出提问预览气泡。↳ 分叉 · L<深度> · <来源标题>。requestAnimationFrame 节流,
钉住几何量测滚动中限流 90ms、滚停后校正;插件从不写 scrollTop。__acConfig({...}) 或 localStorage['dsh-ac-config'])、
aria-* 无障碍与 j/k 导航、中英文案随界面语言切换。MM-DD HH:mm + question summary);
only the newest turn stays expanded.Enter jumps to the next match, Esc closes and restores the list.📌.Today / Yesterday / MM-DD) and a hover preview bubble with that turn's question.↳ Fork · L<depth> · <origin title> at the top.requestAnimationFrame, pin geometry is measured at most once per 90ms while scrolling;
the plugin never writes scrollTop.__acConfig({...}) or
localStorage['dsh-ac-config']), aria-* labels with j/k navigation, and copy that follows the UI language.| 平台 | 状态 |
|---|---|
| Windows 11(DSH Desktop) | ✅ 稳定运行(当前版本) |
| Ubuntu | 🧪 测试中,尚未承诺稳定 |
| macOS | 📋 计划中 |
修复与功能调整的优先级按评论 / 留言的反馈量排序——遇到问题请直接开 issue 或留言, 同类反馈越多越先修。欢迎提交你所在平台的环境信息。
把 DSH Web 会话里的每一次交互压成一行,只保留最近一次展开;点提问行展开,执行过程另行单独点开。
Fold every interaction in a DSH Web chat into a single line and keep only the latest one open. Click a question row to expand it; the execution process opens only when you click its own header.
一个 DSH(DeepSeek Harness)客户端插件。它不修改 app.asar、不碰核心 UI 源码,只在渲染层做三件事:
MM-DD HH:mm + 单行提问摘要(超出省略)。执行过程(思考、工具调用、步骤)不跟着展开:核心本身在回答结束时会收起过程,只有你单独点「过程摘要」那一行才会展开。
┌──────────────────────────────────────────────────────────┐
│ 10-28 13:12 把这批日志按时间排序、去重,然后… › │ ← 折叠(一行)
├──────────────────────────────────────────────────────────┤
│ 10-28 12:58 帮我看下 esp32 的引脚冲突 › │
├──────────────────────────────────────────────────────────┤
│ 你的提问(全文) │ ← 展开(最近一次)
│ …回答正文… │
│ ▸ 12 步 · 思考 8s · 工具 4 次(点开才展开) │
└──────────────────────────────────────────────────────────┘
2.x 的演示动图已移除;交互细节以下文为准(每条都能直接对照界面核对)。
一句话:每一轮对话都折成一行,最新一轮展开;点折叠行看内容,再点收回;钉住的那一轮永远不折。
| 操作 | 结果 |
|---|---|
| 页面加载 / 切换会话 | 只有最新一轮展开,其余全部折成一行(时间 + 提问首行) |
| 点击任意折叠行 | 该轮展开,其他轮自动折回(保证屏幕上只有一份正文,滚动条不会突然变长) |
| 再次点击已展开的那一轮 | 收回成一行 |
| 新轮次到达(含流式输出中) | 上一轮自动折回,新一轮展开;已钉住的轮次不受影响 |
Esc |
全部收回成一行 |
| 状态 | 视觉 |
|---|---|
| 折叠行 | 灰色底 + 次要色文字,时间更淡 |
| 展开行 | 原样,无底色 |
| 钉住行 | 左侧 2px 强调色条;折叠时再叠一层淡蓝底,📌 高亮 |
📌 钉住该轮 → 之后无论来多少新消息,它都保持展开。localStorage['dsh-ac-mem:<会话键>'],重新打开该会话自动恢复。当前/总数。Enter 跳到下一个命中并展开它;Esc 关闭搜索并完整还原列表。Ctrl/Cmd+Shift+K 可打开(最佳努力:DSH 自带查找面板会抢 Ctrl+Shift+F、
Ctrl+Alt+F,有时也抢 Ctrl+Shift+K,所以正式入口是 🔍 按钮)。今天 | 昨天 | MM-DD),跨天时自动分段。↳ 分叉 · L<深度> · <来源标题>,一眼看出出处与层级。visibility / 属性,从不写 scrollTop:滚动位置永远归你,插件不会抢。requestAnimationFrame 节流,不在每次 token 上跑全表。dsh-ac-config)__acConfig({ timeline: false }); // 关时间线
__acConfig({ pin: false }); // 关钉住
__acConfig({ memory: false }); // 关会话记忆
__acConfig({ search: false }); // 关搜索(🔍 按钮一起消失)
__acConfig({ forkchip: false }); // 关分叉徽标
__acConfig({ incremental: false });// 关增量渲染
__acConfig({ i18n: 'en' }); // 强制英文(默认 auto)
__acConfig({ theme: 'light' }); // 强制浅色(默认跟随)
localStorage.removeItem('dsh-ac-config'); // 全部恢复默认
键盘:j / k 在折叠行之间上下移动,Esc 全收;所有可交互元素都带 aria-* 与 aria-live 计数播报。
npm(推荐)
# 桌面版(profile=desktop)
dsh plugin --profile desktop add dsh-session-accordion@2.5.5
# 或免全局安装
npx -y @deepseek-ai/dsh plugin --profile desktop add dsh-session-accordion@2.5.5
# Web UI(profile=web)
dsh plugin --profile web add dsh-session-accordion@2.5.5
安装后完全退出 DSH 再启动;卸载:
dsh plugin --profile desktop remove dsh-session-accordion
以下为源码方式(开发 / 离线环境):
前置:能跑 DSH Web UI 的宿主 —— Windows / macOS 桌面版,或 Linux 上的 dsh web。profile 名随宿主不同:桌面版默认 desktop,dsh web 默认 web,自定义 profile 用你自己的名字。
git clone https://github.com/ayuanxx-max/dsh-session-accordion.git
$repo = (Resolve-Path .\dsh-session-accordion).Path
$nm = "$env:USERPROFILE\.dsh\profiles\desktop\node_modules"
New-Item -ItemType Junction -Path "$nm\dsh-session-accordion" -Target $repo
git clone https://github.com/ayuanxx-max/dsh-session-accordion.git
repo="$(cd dsh-session-accordion && pwd)"
profile="${DSH_PROFILE:-web}" # 桌面版改成 desktop
mkdir -p "$HOME/.dsh/profiles/$profile/node_modules"
ln -sfn "$repo" "$HOME/.dsh/profiles/$profile/node_modules/dsh-session-accordion"
符号链接要写完整路径(从盘符或
/开始,如E:\...、/home/...):相对路径在 profile 目录变化后会失效。 也可以一条命令完成(含 package.json 备份与合并):bash scripts/install.sh --profile web --apply。 Windows 对应:powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Profile desktop -Apply。
# pnpm 会把这枚 tarball 复制进 profile,不依赖符号链接 / junction
dsh plugin --profile web add /path/to/dsh-session-accordion-2.5.3.tgz
# 再把 "dsh-session-accordion" 加进 dsh.profile.bundles,重启 DSH
升级时下载新 tarball 再执行一次即可,不需要
git pull。
// ~/.dsh/profiles/<profile>/package.json
{
"dependencies": {
"dsh-session-accordion": "link:/absolute/path/to/dsh-session-accordion"
},
"dsh": {
"profile": {
"bundles": ["dsh-session-accordion"]
}
}
}
复制进
node_modules也能用,但链接方式升级最省事:git pull后重启即可。
package.json 的 dependencies 与 dsh.profile.bundles 中删掉 dsh-session-accordion。Remove-Item node_modules\dsh-session-accordion;Linux/macOS rm ~/.dsh/profiles/<profile>/node_modules/dsh-session-accordion(只删链接,不动源码)。| 关键点 | 说明 |
|---|---|
| 挂载点 | 客户端插件(dsh.client,platform: web,immediately: true),随 Web 应用加载一次,天然覆盖所有工作区与会话 |
| 轮次分组 | 聊天流容器 [data-slot="conversation.chat.flow"] 下,每个渲染节点带 [data-chat-turn="<turnId>"];同 turnId 归为一轮 |
| 提问识别 | 轮内包含 class 以 _bubble 结尾的元素(用户/steering 气泡共用)的节点 |
| 过程识别 | data-chat-flow-kind="turn-process" 的节点,其内部 button[aria-expanded] 是核心原生折叠开关 |
| 折叠方式 | 给整轮除提问外的节点打 data-ac-hidden(display:none),提问行用伪元素画时间胶囊与摘要,原内容 visibility:hidden |
| 状态 | 按 turnId 存在内存 Map;未知轮次默认「最后一轮展开」,因此切换会话、历史回看都自动收敛 |
| 时间 | 优先读 React fiber 上的 props.node.data.time(不受悬停影响),退回原生时钟文本,都没有就不显示 |
| 自愈 | MutationObserver + 1.5 秒兜底巡检,React 重渲染后重新贴状态 |
设计取向:只叠加,不侵入。核心的折叠状态、流式输出、滚动锚定都不接管;结构认不出时插件什么都不做,只在 console 打一条 warn。
页面 DevTools Console:
__acReport()
输出每一轮的 id / expanded / stamp / summary / items。结构变化(DSH 升级后 DOM 改名)时,看这个能立刻定位是「分组失败」还是「时间取不到」。
python "%USERPROFILE%\.dsh\tools\verify-page.py" --root . --page verify/harness.html --scenario verify/scenarios/b.json --out reports/b
| 平台 / 引擎 | 状态 | 说明 |
|---|---|---|
| Windows(DSH 桌面版,Electron/Chromium) | ✅ 主力验证 | 本轮开发基准 |
| macOS(桌面版;Tauri/WebView 需较新内核) | ✅ 设计兼容 | 只用标准 mask-image + 内联 SVG,无平台 API |
| Ubuntu / Debian 等 Linux(Chrome / Edge / Chromium) | ✅ CI 验证安装链路 | 安装脚本、打包、安装冒烟测试跑在 ubuntu-latest 上 |
| Linux 上的 Firefox | ⚠️ 未实测 | 用到 mask-image(Firefox 支持无前缀写法);最坏情况只失去渐隐,不影响折叠 |
window.__dshAccordion = { timeZone: 'Asia/Shanghai' } 后刷新页面即可覆盖。prefers-reduced-motion),开启后不播放展开淡入。data-chat-turn 等),属非公开契约,上游改版可能失效;失效时插件静默不动作,不会破坏界面。time 时不显示时间,只显示摘要。DSH 生态里已有若干「回合折叠」插件,取舍不同:
| 项目 | 形态 | 与本项目的差别 |
|---|---|---|
| a179-sanae/dsh-auto-collapse | 把正文之间的思考/工具/上下文合成二级折叠,保留原生回合摘要 | 答案始终可见;不限制同时展开的轮数 |
| leon-zym/dsh-fold-turns | 完成回合折成一行 Worked for …,保留用户消息与回答 |
已标记弃用(DSH 0.1.5+ 原生支持过程折叠) |
| tntcannon5000/dsh-chat-fold | 在最终回答上方插入 disclosure | 回答不隐藏;不是手风琴 |
| 本项目 | 整轮(提问 + 回答 + 过程)压成一行,只允许一条展开 | 空间优先:点开才看该轮内容 |
选择建议:想「一眼扫完所有答案」用上面那类;想「一屏看完整个会话骨架、按需展开」用本项目。
MIT,见 LICENSE。
A client plugin for DSH (DeepSeek Harness). It never edits app.asar or any core UI source; it only layers three behaviours on top of the rendered transcript:
MM-DD HH:mm) plus a single-line summary of your question, ellipsized when long.The execution process (thinking, tool calls, steps) does not expand with the turn: DSH folds it when the answer completes, and it opens only when you click its own summary row.
┌──────────────────────────────────────────────────────────┐
│ 10-28 13:12 Sort these logs by time, dedupe, then… › │ ← folded (one line)
├──────────────────────────────────────────────────────────┤
│ 10-28 12:58 Check the ESP32 pin conflicts › │
├──────────────────────────────────────────────────────────┤
│ Your full question │ ← expanded (latest)
│ …answer body… │
│ ▸ 12 steps · 8s thinking · 4 tool calls (click to open) │
└──────────────────────────────────────────────────────────┘
The 2.x demo GIFs are gone; the interaction details below are the reference.
Every chat turn folds into one line; only the newest turn is expanded. Click a folded line to expand it (others fold back), click it again to fold it. Pinned turns never fold.
| Action | Result |
|---|---|
| Page load or session switch | Only the newest turn is expanded; every other turn is one line |
| Click a folded line | That turn expands and the previously open one folds back (one body on screen at a time) |
| Click the open turn again | It folds back to one line |
| A new turn arrives (even while streaming) | The previous turn folds; pinned turns stay open |
Esc |
Fold everything |
| State | Look |
|---|---|
| Folded | Grey chip + secondary text colour, dimmer timestamp |
| Expanded | No chip, plain body |
| Pinned | 2px accent bar on the left; folded pinned turns also get a light blue tint and a lit 📌 |
📌 at the end of a folded line to pin that turn; it then stays expanded no matter how
many new messages arrive. Click again to unpin.localStorage['dsh-ac-mem:<session key>'] and restored
when you reopen that session.current/total counter is shown.Enter jumps to the next match and expands it; Esc closes search and restores the list.Ctrl/Cmd+Shift+K also opens it (best effort: DSH's own finder grabs Ctrl+Shift+F,
Ctrl+Alt+F and sometimes Ctrl+Shift+K, so the 🔍 button is the reliable entry point).Today / Yesterday / MM-DD) are inserted per day; hovering a folded line shows a
preview bubble with that turn's question.↳ Fork · L<depth> · <origin title> at the top.scrollTop; you always own the scroll position.requestAnimationFrame instead of re-walking the whole transcript per token.__acConfig({ timeline: false, pin: false, memory: false, search: false,
forkchip: false, incremental: false, i18n: 'en', theme: 'light' });
localStorage.removeItem('dsh-ac-config'); // back to defaults
Keyboard: j / k move between folded lines, Esc folds everything; interactive elements expose
aria-* attributes and an aria-live counter.
Prerequisite: a host that runs the DSH Web UI — the Windows/macOS desktop app, or dsh web on Linux. The profile name depends on the host: desktop for the desktop app, web for dsh web, or your own name for a custom profile.
git clone https://github.com/ayuanxx-max/dsh-session-accordion.git
$repo = (Resolve-Path .\dsh-session-accordion).Path
$nm = "$env:USERPROFILE\.dsh\profiles\desktop\node_modules"
New-Item -ItemType Junction -Path "$nm\dsh-session-accordion" -Target $repo
git clone https://github.com/ayuanxx-max/dsh-session-accordion.git
repo="$(cd dsh-session-accordion && pwd)"
profile="${DSH_PROFILE:-web}" # use desktop for the desktop app
mkdir -p "$HOME/.dsh/profiles/$profile/node_modules"
ln -sfn "$repo" "$HOME/.dsh/profiles/$profile/node_modules/dsh-session-accordion"
The symlink must use an absolute path; a relative target breaks as soon as the profile directory moves. One-shot alternative (backs up and merges
package.json):bash scripts/install.sh --profile web --apply. Windows equivalent:powershell -ExecutionPolicy Bypass -File scripts\install.ps1 -Profile desktop -Apply.
# pnpm copies the tarball into the profile; no symlink or junction involved
dsh plugin --profile web add /path/to/dsh-session-accordion-2.5.3.tgz
# then add "dsh-session-accordion" to dsh.profile.bundles and restart DSH
To upgrade, download the new tarball and run the command again; no
git pullneeded.
// ~/.dsh/profiles/<profile>/package.json
{
"dependencies": {
"dsh-session-accordion": "link:/absolute/path/to/dsh-session-accordion"
},
"dsh": {
"profile": {
"bundles": ["dsh-session-accordion"]
}
}
}
Copying the repo into
node_modulesalso works, but a symlink keeps upgrades togit pull+ restart.
dsh-session-accordion from dependencies and dsh.profile.bundles.Remove-Item node_modules\dsh-session-accordion; Linux/macOS rm ~/.dsh/profiles/<profile>/node_modules/dsh-session-accordion (the link only; the source directory stays).| Point | Detail |
|---|---|
| Mount | A client plugin (dsh.client, platform: web, immediately: true) loaded once with the web app, so it covers every workspace and session |
| Turn grouping | Inside [data-slot="conversation.chat.flow"], each rendered node carries [data-chat-turn="<turnId>"]; nodes sharing a turn id form one turn |
| User node | The node whose subtree contains an element with a class ending in _bubble (user and steering bubbles share it) |
| Process node | The node with data-chat-flow-kind="turn-process"; its button[aria-expanded] is the built-in fold control |
| Folding | Marks every non-user node of the turn with data-ac-hidden (display:none); the user row draws its pill and summary with pseudo-elements while the real bubble is visibility:hidden |
| State | An in-memory Map keyed by turnId; unknown turns default to "last one expanded", which is why session switches and history reloads converge on their own |
| Timestamp | Read from the React fiber (props.node.data.time) first, then the native clock text; nothing is invented if neither exists |
| Self-healing | MutationObserver plus a 1.5 s safety sweep re-applies state after React re-renders |
Design stance: layer, never invade. Core folding, streaming output and scroll anchoring stay untouched; when the structure cannot be recognised the plugin does nothing and logs a single warn.
In the page DevTools console:
__acReport()
It prints id / expanded / stamp / summary / items per turn. After an upstream UI change this tells you immediately whether grouping failed or the timestamp went missing.
| Platform / engine | Status | Notes |
|---|---|---|
| Windows (DSH desktop, Electron/Chromium) | ✅ primary target | Development baseline |
| macOS (desktop app; Tauri/WebView needs a recent engine) | ✅ designed to work | Standard mask-image plus inline SVG only, no platform APIs |
| Ubuntu / Debian and other Linux (Chrome / Edge / Chromium) | ✅ install path verified in CI | installer, packaging and install smoke test run on ubuntu-latest |
| Firefox on Linux | ⚠️ not exercised | uses mask-image (Firefox ships the unprefixed property); worst case the fade is lost, folding still works |
window.__dshAccordion = { timeZone: 'Asia/Shanghai' } in the console and reload to override.prefers-reduced-motion; the expand fade is skipped when it is enabled.data-chat-turn, …). That is a private contract and may break on an upstream redesign; the plugin then fails safe by doing nothing.time shows a summary only.The DSH ecosystem already has a few turn-folding plugins. They make a different trade-off:
| Project | Shape | Difference from this one |
|---|---|---|
| a179-sanae/dsh-auto-collapse | Merges reasoning/tool/context blocks between prose into a secondary disclosure, keeping the native turn summary | The answer always stays visible; several turns can be open at once |
| leon-zym/dsh-fold-turns | Folds a completed turn into a Worked for … row, keeping the user message and answer |
Marked deprecated (DSH 0.1.5+ folds processes natively) |
| tntcannon5000/dsh-chat-fold | Inserts a disclosure above the final answer | The answer stays visible; not an accordion |
| This project | Folds the whole turn (question + answer + process) into one row and allows only one open turn | Space first: click a row to read that turn |
Pick the former if you want to skim every answer at once; pick this one if you want the whole session skeleton on one screen and open turns on demand.
MIT, see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。