dove-a/dsh-chat-window-fold
dove-a★ 0JavaScriptLast synced: 2026-08-15
DSH web GUI plugin: auto fold/expand the chat window — bottom checkpoints hide old pages, top-scroll expands earlier messages with the viewport anchored.
README excerpt
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。
View full README on GitHub →