Skip to content

v0.12.0 — 历史会话可折叠可删除 / Foldable, deletable history

Choose a tag to compare

@Dclef Dclef released this 18 Oct 10:49
· 11 commits to main since this release

中文

0.12.0 重做面板的历史会话卡:长列表不再撑长页面,每一行都可以单独删掉。

  • 限高滚动 + 折叠:历史会话一条一次运行、只增不减,所以列表收进最高 300px 的滚动框,表头 sticky 固定;标题变成折叠开关(▾/▸),折叠状态记在浏览器 localStorage,刷新和切换语言都保持。标题旁新增行数徽标。
  • 每行可删除:新增「操作」列,里面是红色删除。因为不可逆,做成两段式——第一次点击只把该行变成「确认删除」并在表下提示后果,再点一次才执行;中间轮询刷新不会冲掉挂起的确认。
  • 新路由 POST /plugins/dsh-cursor-dev/api/forget?key=:按 resetSession 的同一条链路清理,先 pool.dropConversation 停掉活着的代际,再清 journal(新增 journal.clearConversation 按 parent::label#N 前缀扫,原来的 clear 只能精确命中一个键),然后删索引里的持久行,最后关掉镜像子会话。少撤任何一步,这一行都会在下一次轮询里复活。对已经删掉的行再点一次返回 ok + existed: false,不会变成 404。
  • 安装源:npm 公共源上当前仍是 0.11.1(0.12.0 未发布),要用折叠/删除请装 Git 来源 git+https://github.com/Dclef/dsh-cursor-dev.git。
  • 验证:npm test 216 项全绿(离线 213 项,三个真实账号测试自带 skip);新增测试覆盖折叠结构、限高、删除列、两段式交互,以及 /api/forget 的 405/400/200 与幂等语义。

English

0.12.0 reworks the panel's history card: a long list no longer stretches the page, and each row can be deleted on its own.

  • Capped scroll box + fold: the history table keeps one row per run forever, so it now scrolls inside a 300px box with a sticky header, and its heading is the fold control (▾/▸). The fold choice is stored in browser localStorage and survives reloads and language switches. A row-count pill sits next to the heading.
  • Per-row delete: a new actions column carries a red Delete. It is irreversible, so it takes two clicks — the first only arms the row (label becomes "Confirm delete" and a note under the table states the consequences), the second fires; a poll repaint in between does not lose the pending confirmation.
  • New route POST /plugins/dsh-cursor-dev/api/forget?key=: it clears the run along the same chain as resetSession — evict the pool's live generations first, then the journal (new journal.clearConversation sweeps the parent::label#N prefix, which the exact-key clear cannot), then the durable index row, then the mirrored child. Leaving any one of those behind brings the row back on the next poll. Clicking delete on an already-gone row answers ok with existed: false rather than a 404.
  • Install source: the public npm registry still serves 0.11.1 (0.12.0 is not published), so use the Git source git+https://github.com/Dclef/dsh-cursor-dev.git for this work.
  • Verification: npm test is 216 passing (213 offline; the three real-account tests skip themselves). New tests cover the fold/height markup, the delete column, the two-click interaction, and the 405/400/200 and idempotent semantics of /api/forget.