Repository navigation
Releases
Releases · Stylelinzzz/dsh-chat-history
v0.1.2 — DSH 0.1.5 compatibility
DSH 0.1.5 compatibility / 适配 DSH 0.1.5
DSH 0.1.5 restructured its client internals and broke this plugin in two ways. Both are fixed; the plugin now runs on 0.1.5+ and keeps working on older profiles. / DSH 0.1.5 重构了客户端内部结构,从两处破坏了本插件。现均已修复,插件在 0.1.5+ 与更早版本上都能工作。
What broke / 故障原因
- Chat nodes moved. 0.1.5 relocated the chat nodes out of the session snapshot into a dedicated
useChatstandard hook (provided bydsh-client-ui-chatviauiSession.provide({ hooks: ["chat"] })). The plugin readuseSession((s) => s.chat.order), so the directory rendered nothing. / 0.1.5 把 chat 节点从会话快照搬进了独立的useChat标准 hook;插件原先读useSession((s) => s.chat.order),升级后目录空白。 - A declared dependency vanished.
dsh-client-runtimewas removed and split intodsh-client-ui-chat/-session/-renderer, whiledsh.client.injectstill listed it. /dsh-client-runtime被移除并拆分为三个包,而插件的dsh.client.inject仍声明着它。
Fixes / 修复内容
- Dual-source data path —
useChat((s) => s.order)/s.nodeson 0.1.5+, legacys.chat.*before it. The variant is picked by whether theuseChatprop exists, and each variant calls its own hooks unconditionally, so the rules of hooks hold. Both render through one shared body component. / 双数据源:0.1.5+ 用useChat,更早版本用s.chat.*;依据useChatprop 是否存在分发,各变体无条件调用自身 hook,共用同一套渲染逻辑。 - Official view switch — jumps now use the
openView("chat")owner prop instead of synthesizing a tab click (the tab click remains the fallback on older builds). / 官方切视图 API:跳转改用openView("chat"),旧版本回退点击 tab。 - Dependency list refreshed — mirrors the official
ui-trajectoryplugin's list plusdsh-client-ui-chat. / 依赖列表更新:对齐官方ui-trajectory并补上dsh-client-ui-chat。 - Paging hardened — the old probe for "did this page add nodes" read
session.getSnapshot().chat.order.length, a field 0.1.5 relocated; it silently reported no progress, which would have capped auto-loading at 3 pages. Paging now depends only on the stablehasMore/loadingOlderflags, bounded by a 200-page budget. / 分页加固:旧的"本页是否新增节点"判断读了被搬走的字段,静默失效会让自动加载只跑 3 页就停;现在只依赖稳定的hasMore/loadingOlder,另设 200 页上限。 - Self-contained type declarations — no imports from the movable upstream package layout. / 类型声明自包含:不再 import 会随上游变动的包路径。
Install / 安装
dsh plugin --profile web add dsh-chat-historyRestart dsh web after installing or upgrading: a change to dsh.client.inject is cached by the client module registry until the process restarts. / 安装或升级后请重启 dsh web:dsh.client.inject 的变更会被客户端模块注册表缓存到进程结束。
Full changelog / 完整变更:CHANGELOG.md