docs: record the contributor batch, rc3 evidence and release dependency slim-down (#1115 #1130 #882 #1191)

This commit is contained in:
Menghuan1918 committed 2026-11-16 00:49:08 +08:00
1 parent 0441249314
commit 5575ee29b9
8 files changed
+103 -3

No files matched your search

+8 -1
View File
@@ -69,7 +69,14 @@
逐项证据:[0.2.2-rc.2 适配记录](plans/2026-11-12-dsh-0.2.2-rc.2-adaptation.md)。
## 8. 适配记录索引
## 8. 0.2.2-rc.2 → 0.2.2-rc.3:已验证,无代码变化
- rc.3 与本插件消费面的源码差异只有 `@deepseek-ai/dsh-client-ui-primitives` 的 `src/icons/artwork.ts`(+1)与 `src/icons/index.tsx`(+6);其余是各包 `package.json` 版本、CI、桌面更新重启状态和无关的 DeepSeek 会话导入功能。`Menu` / `ui-sidebar-right` / `dsh-session` / `dsh-tools` / `dsh-agent` / `dsh-client-ui-*` 的 API 没有变化。
- 因此 `peerDependencies` 的 `^0.2.2-rc.2` 同时接受 rc.2 与 rc.3,`dsh.plugin.json#engines.dsh` 的 `>=0.2.2-rc.2` 也接受;**不新增任何运行时兼容代码**。
- 验证方式:在临时 worktree 把 devDependencies 的 30 条 DSH 包临时升到 `0.2.2-rc.3`(不提交),跑 `typecheck` / 全量 `test` / `build`,再用 rc.3 宿主跑真实挂载;dev 钉版与 CI 仍保持 rc.2 基线。
- 结论:当前构建服务 **0.2.2-rc.2 与 rc.3 两条 RC**;支持线表不变(`0.2.2-rc.2+`)。
## 9. 适配记录索引
- [0.2.2-rc.2](plans/2026-11-12-dsh-0.2.2-rc.2-adaptation.md)
- [0.2.2-rc.1](plans/2026-11-04-dsh-0.2.2-rc.1-adaptation.md)
+6
View File
@@ -59,3 +59,9 @@
- **桌面壳的 Cmd+Q 在页面之外**。macOS Desktop(`DSH Tauri.app`,内置 Electron 44.7.0)的主进程 `Contents/Resources/runtime/darwin-arm64/main.cjs` 订阅了 `app.on('before-quit')`:`preventDefault()` 后经 IPC 发 `app.exitRequested`,由壳自行完成退出;页面拿不到可取消的 quit 事件。壳内**没有** `will-prevent-unload` 处理(runtime 目录与壳可执行文件 grep 0 命中),因此若关闭最终走 `webContents.close()`,Electron 对 `beforeunload` 返回值的默认语义是**静默取消关闭**——这是 #1071「有脏草稿时 Cmd+Q 偶发退不掉、也没有确认框」的合理机制,但尚无 instrumentation 证据,不当作已证实根因。插件无法区分「被静默取消」与「页面成功拦截」,因此**不移除** `Sidebar.tsx` 的 `beforeunload`(浏览器刷新仍需要它);该 guard 现在会先 flush 草稿备份再拦截。
- **插件侧结论**:不伪造拦截,改为**降低损失**——`src/client/editor-draft-backup.ts` 在草稿变脏时按 1 s 节流写 `localStorage`(key = `sessionId::path`;单条 200k 字符、总计 600k 字符、最多 8 条、FIFO 淘汰),并在原生 `registerCloseHandler('editor')` 与 `beforeunload` 里立即 flush;重开同一文件由 `TextEditor` 提示恢复。保存成功、确认丢弃、确认刷新 / 就地换文件都会删除对应备份。
- **宿主若补上能力**:`will-prevent-unload` 对话框(Electron 主进程)或退出前可取消钩子,就能做真正的「保存 / 丢弃 / 取消」。届时在 `Sidebar.tsx` 的 `beforeunload` 与 `native/index.ts` 的关闭回调处接入 `confirmDiscardDraft`,再删掉这条降级路径。
## D. 0.2.2-rc.2 / rc.3 的两条客户端契约(2026-11-16)
- **`chatFileMentions.forClosing` 是可选的三参服务**(0.2.2 线由 `ui-deliverables` 提供):`(owner, sessionId, getFileTriggerProps?)`。任何包装必须把第三个参数原样转给 stock provider,否则宿主自己的文件提及会丢掉右键菜单;包装自己的匹配项也应把 `getFileTriggerProps(path)` 挂到 `contextMenuProps`。释放时只在 `service.forClosing === wrapped` 时恢复,且旧 resolver 的 `open` 要因 `active=false` 失效。宿主没有该服务(未组合 deliverables)时,插件不另造 provider,功能静默缺席。
- **sidechat 的原生 occurrence 身份**:宿主页面地址在 `multiple` 开启时是 `sidebar://sidechat/<uuid>`,共用页是固定的 `sidebar://sidechat`;宿主持久化布局与 contentId,但不持久化 navigation.params。插件只在多实例形态下按 `(sessionId, contentId)` 读写线程绑定;共用页继续用会话 last/newest 回退。原生 ×/菜单关闭经 `ctx.sidebarRight.registerCloseHandler('sidechat', ...)` 清理并归档该线程,组件卸载/刷新/插件卸载不归档;宿主该注册按 kind 唯一,重复注册会抛错,surface 释放时必须注销。
- **0.2.2-rc.3 与 rc.2 的差异仅在图标与包版本**:rc.3 的源码差异只有 `ui-primitives/src/icons/artwork.ts`(+1)与 `icons/index.tsx`(+6),另加无关的桌面更新/DeepSeek 会话导入改动;本插件消费的 Menu / sidebar-right / session / tools / agent / client-ui-* 均无 API 变化。因此 `^0.2.2-rc.2` 同时覆盖 rc.2 与 rc.3,不写运行时兼容层。
@@ -0,0 +1,72 @@
# 2026-11-16 contributor PR batch: side-chat mode, responsive repo switcher, chat paths, release deps
## Scope
- Integrate contributor PRs #1115 (independent native Side Chat tabs), #1130
(multi-repository picker) and #882 (absolute Markdown paths in chat).
- Fix #1191: the published package installs libraries that are already bundled
into `lib/client*.js`.
- Triage #1201 (file-tree right-click on desktop) without a speculative code
fix: the reporter could not be reproduced on macOS Web or Desktop, and the
proposed `contextual` explanation does not match the host Menu source.
## Product decisions
- **#1115 is opt-in.** The default remains one shared native page with the
session's last/newest thread reattach. Settings → Side card → Side chat →
Side-chat pages switches to one native page per thread. The switch affects
later opens only; existing tabs keep their identity. Occurrence bindings are
read/written only for `sidebar://sidechat/<uuid>` contentIds, so the shared
page cannot be captured by an old binding.
- **#1130 stays above Changes.** The switcher renders natural-width chips while
every location label fits, and one native select once it does not. A hidden
natural-width row makes the decision content-driven. Labels and the server
fallback stand-in are shared with the ⋯ → Repository submenu. No fixed
viewport breakpoint, no extra polling.
- **#882 forwards the host gesture.** DSH 0.2.2's
`chatFileMentions.forClosing(owner, sessionId, getFileTriggerProps?)` third
argument is forwarded to the stock provider; the added absolute-path match
also carries the host file context-menu binding.
- **#1191 keeps `src`.** Only bundled libraries move to devDependencies;
`./src/*` is an existing export surface and removing it would be a breaking
change.
## Host compatibility
- rc.2 → rc.3 source diff in the consumed packages is limited to
`ui-primitives` icons/artwork and package versions; no API changes. The
`^0.2.2-rc.2` peer floor already accepts rc.3, so both RCs are supported
without compatibility code. Verification uses a temporary rc.3 dev tree and
a real rc.3 mount; dev pins/CI stay on the rc.2 baseline.
- sidechat uses the host's stable per-occurrence `contentId`, `openTabs`
inventory and `registerCloseHandler`; the shared page keeps the host's
singleton identity.
## #1201 triage
The issue's proposed `Menu.contextual` / `isExternalTrigger` fix does not
explain a menu that never opens: in the rc.2 source, `contextual` controls
cursor positioning, right-click dismissal inside the popup, ARIA linkage and
icon-column alignment; `anchorPoint` already supplies the cursor position.
A diagnostic comment was posted asking for the DSH/plugin versions, OS/desktop
or Web, sidebar mode, console errors, whether a `[role="menu"]` node exists,
whether other host/plugin context menus work, and a read-only probe script.
## Verification
- [ ] `pnpm typecheck`
- [ ] `pnpm lint`
- [ ] full `pnpm test`
- [ ] `pnpm build` + `pnpm check:consumer-types`
- [ ] `pnpm pack` + temp install (only `ws` / `yaml`)
- [ ] real-host Chromium mount (shared + independent sidechat, guide/tabs)
- [ ] rc.3 temporary dev tree + real rc.3 mount
- [ ] CI on `dev`
## Links
- [#1115](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1115)
- [#1130](https://github.com/omdsh-dev/DSH-better-sidebar/pull/1130)
- [#882](https://github.com/omdsh-dev/DSH-better-sidebar/pull/882)
- [#1191](https://github.com/omdsh-dev/DSH-better-sidebar/issues/1191)
- [#1201](https://github.com/omdsh-dev/DSH-better-sidebar/issues/1201)