dove-a/dsh-chat-window-fold ↗★ 0
dsh-chat-window-fold
Fold and expand the dsh web chat window automatically: event-cycle checkpoints (every 25 session events, from N=75) fold older loaded pages beyond the recent 50 rows when the viewport sits at the bottom; scrolling to the very top appends up to 50 earlier messages with the viewport kept in place, repeated until no more history. Per-session isolated; window stays below ~75 rows (low-end friendly); system "Load earlier" button hidden; configurable via row config (foldThreshold=50, foldCheckEvery=25). A DSH web profile bundle.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:dove-a/dsh-chat-window-fold说明文档
阅读完整 README ↗dsh-chat-window-fold
DSH Web GUI 插件:聊天窗口自动折叠/展开(对系统自带的分页窗口的增强)。
功能
- 自动折叠:以「会话累计事件数」为钟(每
foldCheckEvery个事件一个判定点,前两次跳过、自 N=75 起判定),当你滚动到底部且窗口已超过foldThreshold行时,把手眼神之外的早期消息悄然折叠,窗口始终保持在约 50 条(窗口峰值 75)里滚到底部即可看到早期消息被折叠;滚到顶部可逐批追回。也可用dsh --profile web --dump-config确认组合树出现chat-window-fold行。
卸载:dsh plugin --profile web remove dsh-chat-window-fold,然后重启 dsh web。
配置
阈值与判定周期经行 config 配置(无 UI 开关):
| 键 | 默认 | 说明 |
|---|---|---|
foldThreshold | 50 | 折叠后保留的最近行数 |
foldCheckEvery | 25 | 判定周期(会话累计事件数;前两次 N=25/50 跳过,自 N=75 起判定) |
限制与说明
- 折叠为显示层实现(隐藏窗口外行;展开时恢复显示并从宿主拉取)。宿主与 runtime 的窗口数据按只读协议保持完好,不影响模型上下文;当前 runtime 未暴露窗口截断 API,隐藏行仍驻留浏览器内存(
display:none不参与布局)。 - 判定即「每 25 事件比较一次」,无常驻维护;窗口实际峰值约为 50+25=75 行,低配机器友好。
- 依赖
ui-conversation的槽协议(conversation.input.dock标准 props:sessionId/useSession)与 DOM 挂点([data-conversation-scroll]、[data-chat-flow]、[data-chat-anchor-key]、[data-composer-seat]),请保持 DSH 为较新版本(0.1.0-rc.*系列)。
许可证
Apache-2.0,见 LICENSE。