Skip to content

Releases

v0.1.2 — DSH 0.1.5 compatibility

Choose a tag to compare

@Stylelinzzz Stylelinzzz released this 12 Sep 05:44

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 / 故障原因

  1. Chat nodes moved. 0.1.5 relocated the chat nodes out of the session snapshot into a dedicated useChat standard hook (provided by dsh-client-ui-chat via uiSession.provide({ hooks: ["chat"] })). The plugin read useSession((s) => s.chat.order), so the directory rendered nothing. / 0.1.5 把 chat 节点从会话快照搬进了独立的 useChat 标准 hook;插件原先读 useSession((s) => s.chat.order),升级后目录空白。
  2. A declared dependency vanished. dsh-client-runtime was removed and split into dsh-client-ui-chat / -session / -renderer, while dsh.client.inject still listed it. / dsh-client-runtime 被移除并拆分为三个包,而插件的 dsh.client.inject 仍声明着它。

Fixes / 修复内容

  • Dual-source data path — useChat((s) => s.order) / s.nodes on 0.1.5+, legacy s.chat.* before it. The variant is picked by whether the useChat prop 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.*;依据 useChat prop 是否存在分发,各变体无条件调用自身 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-trajectory plugin's list plus dsh-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 stable hasMore / loadingOlder flags, 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-history

Restart 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