Repository navigation
v0.12.0 — 历史会话可折叠可删除 / Foldable, deletable history
中文
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 test216 项全绿(离线 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
localStorageand 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 asresetSession— evict the pool's live generations first, then the journal (newjournal.clearConversationsweeps theparent::label#Nprefix, which the exact-keyclearcannot), 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 answersokwithexisted: falserather than a 404. - Install source: the public npm registry still serves
0.11.1(0.12.0is not published), so use the Git sourcegit+https://github.com/Dclef/dsh-cursor-dev.gitfor this work. - Verification:
npm testis 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.