Commit Graph
15 Commits
Author SHA1 Message Date
Menghuan1918 0441249314 feat(sidechat): make the native page mode configurable (#1115)
Keep the contributor independent-page implementation, but make it opt-in: the default is still one shared page with the session last/newest reattach, and Settings -> Side card -> Side chat can switch to one native page per thread. The descriptor gains a dynamic multiple predicate, native sync re-registers on a flip, and occurrence bindings are read/written only for sidebar://sidechat/<uuid> contentIds so the shared page can never be captured by an old binding.
2026-11-16 00:47:59 +08:00
peng xiang ba6f3a3423 fix(sidechat): preserve independent native tabs and exact thread bindings 2026-11-16 00:39:39 +08:00
ymac 6f2054a56c fix(sidebar): 会话地址的基准统一到会话 header cwd(#947 / #950)
会话地址 `dsh-resource://file/session/<sid>/<path>` 的相对路径,宿主构造端
(ui-chat 的 openFile)与解析端(api-workspace-files)都取会话存储的 header cwd;
插件自 #802 起让 fs 路由与原生 tab 体跟随活动 worktree 根,于是地址里的相对拼写
被活动根再拼一次:worktree 嵌在 header cwd 之下时路径翻倍(ENOENT,聊天链接与
改动页都中招),两个检出都有同名文件时静默读到另一份(可保存写回)。

规则:构造端与消费端共用同一个基准,并在地址被读到的边界把它解析成绝对路径——
绝对路径在任何基准下都一样,下游再无可重定基的余地。

- 新增 src/client/address-base.ts 的 addressBaseOf(ctx, sessionId):会话列表里的
  header cwd(宿主地址契约的基准),取不到返回 undefined 让调用方回退。
- 消费边界:fileParamsOf(info, base?) 在切 `path:line` 规格之前把地址路径解析成
  绝对路径;native/index.ts 的 editor 类型注入
  paramsOf: (info) => fileParamsOf(info, addressBaseOf(ctx, fileSessionIdOf(info)))。
- 构造边界:native/surface.ts 的 fileAddress 与 sidebar-file.ts 的
  openClaimedNativeFile 都以 addressBaseOf 优先,调用方 cwd 只作回退——同一文件
  只有一个地址(与宿主聊天路径的地址一致,页签照旧合并)。
- 意图侧:openSidebarFile(ctx, sessionId, path, { line?, cwd? }) 的 cwd 是调用方
  手上的活根(EditorHost / 改动页 / markdown 面板传 useSessionRoot 的结果),
  相对路径按它解析,缺省才回退 header cwd——同一相对路径在各入口不再落到不同检出。
- 测试:新增 tests/worktree-address.spec.ts(基准三态 / 绝对路径不可重定基 /
  构造端基准 / 相对路径按活根解析),真 git worktree 夹具;file-open-claim 的
  `line` 位置参数随之改为 `{ line }`(唯一签名变更点)。
2026-10-14 23:18:08 +08:00
unsc9 e4a2d530ea refactor(tabs): 精简改名/删除页签调解的原生枚举与用例装配(行为不变)
上一个提交(e876aa9)过了一轮「代码精简」审查(复用 / 简化 / 效率 / 修在哪一层
四个角度,四个只读子代理并发),这里只落地行为完全不变的那批,净减 37 行。

- **原生页签枚举接回仓库既有的那条缝**:`SidebarSurface` 已有 `tabTypeOf?`
  (存在理由逐字相同:「service 自己看不见原生记录」),新增可选
  `pathTabs?()`,service 上加 `@internal nativePathTabs()` 转发。删掉
  `src/client/native/surface.ts` 里的模块级单例 `installed`、
  `installedNativeSurface()`,以及 dispose 里那条「只有仍是当前实例才清句柄」
  的顺序敏感守卫——那是同一个状态被存两份才需要的补丁。`NativePathTab` 从
  `native/tab-adapter.tsx` 上移到 `service.ts`(与 `NativeTabParams` 并列,
  `SidebarSurface` 的方法就引用它),`createNativeSurface` 因此回到直接
  `return { … }`,不再需要局部 `surface` 变量。
- `tab-adapter.tsx` 的 `ensure()`:`adopted`(三目求值 + `!== undefined` +
  `||`)改成具名布尔 `newNavigation`,`meta` 与 `path` 共用一次判断。真值表
  逐格等价(revision 缺省 → true;已定义且不同 → true;已定义且相同 → false)。
- `closePathTabs` 的 `tab.absolute !== target &&` 多余:`isWithinWorkspace`
  本身对目标自身就返回 true,一条判断同时覆盖「这个文件」与「这个目录下」。
- `EditorHost.tsx` 的布尔 `movedPath` 与 `tree-mutations.ts` 里返回**路径**的
  `movedPath` 撞名,改成 `pathChanged`。
- 用例装配:`mountNativeSession()` 一次装好 store / service / editor 描述符 /
  原生承载面 / 会话,`resetModuleRegistries()` 供 `beforeEach` 与 `afterEach`
  共用,`openNativeFile()` 参数化 seat 与 cwd(收掉两处手写 `records.ensure`)。
  六个用例各自少 5 行样板,用例数与断言不变(15 条)。

按「超出本次 diff / 会改变行为」跳过的三条,留档:改名标记改挂 `SidebarTab`
临时字段(要动持久化 schema 与 `updateTab` 公开 patch 类型)、标记在「宿主直接
关页签且编辑器不再挂载」这条极端路径上不回收(每次几百字节)、批量删除逐行重跑
全量枚举(低于可测量门槛)。

验证:`tsc --noEmit` 通过;eslint 对 6 个改动文件无输出;`vitest run --dir tests`
189 个文件 2240 条用例,184 个文件通过,8 条失败均与本次改动无关且为环境原因
(3 条 Windows 建符号链接 EPERM、1 条 `tar` 在 Windows 输出 CRLF 使结尾带 `\r`、
4 条中文语言标签)——覆盖本次改动模块的用例全绿(`editor-unsaved-guard` 15、
`native-surface` 50,另有 `service`、`editor-host`)。旁证:本地
`.tmp-audit/upstream-tree` 那份不含本改动的镜像副本,在 `tasks-model` 上红的是
同样 4 条。
2026-10-11 16:49:24 +08:00
unsc9 e876aa9667 fix(tabs): 改名/删除的页签调解覆盖右侧栏原生页签,并让改名不再重载文档
文件树改名/删除后的页签调解只走 `state.bottomSplits`(插件自己的底部工作台),
而当前架构下文件默认开在 **DSH 原生右侧栏**:有原生承载面时 `service.openTab`
直接走 native,从不写 store。那些页签因此从不参与调解——

- 改名后:页签仍绑旧路径,`EditorHost` 的保存按旧名字写盘;旧名字已被改掉,
  `fs.write` 的 `mkdir -p` + 写入把旧文件(连同被一并删掉的父目录)重建出来,
  界面还报「已保存」。仓库里于是同时留下新旧两份,新名字那份是旧内容。
- 删除后:连「有未保存改动,确定关吗」都不弹(`closePathTabs` 同样只遍历底部
  工作台),Ctrl+S 直接复活刚删掉的文件。

改动:

- `NativeTabRecords.pathTabs()` 按路径枚举原生记录(带 seat session),
  `NativeSurface.fileTabs()` 把它交给调解;`installedNativeSurface()` 是插件自身
  读原生承载面的句柄(模块级,与 `editor-dirty.ts` 同款「每次激活一份」)。
- `tree-mutations.ts`:两个页签空间一起遍历;改名按**子树**匹配(与删除同口径,
  此前只有删除覆盖子树,目录改名时子树里的页签连底部工作台也不改道);原生页签
  的关闭带上自己的 seat session。
- 改名**不重载文档**:`path` 变化原本会让编辑器重载,而重载会换掉文档并丢掉只存在
  于编辑器实例里的草稿——可改名并没有改字节。现在 `retargetPathTabs` 用
  `markRetargetedPath` / `consumeRetargetedPath` 把这次移动交给编辑器认领:文档与
  草稿留着,下一次保存落到新名字;没有这个标记的 `path` 变化(真实切换文件)照旧
  加载。
- `tab-adapter.tsx` 的 `ensure()`:`path` 与 `meta` 一样,只被「尚未采纳的导航修订」
  覆盖。原生承载面每次渲染都重投同一次导航,无条件按地址改 `path` 会把插件侧的
  改址当渲染垃圾丢掉——调解刚改完,下一次渲染就改回旧名字。
- 设计文档补实施偏差:`docs/plans/2026-09-04-file-tree-rename-delete-design.md`。

用例:`tests/editor-unsaved-guard.spec.tsx` 新增 `tree rename/delete
reconciliation`(原生页签改名改址、目录改名两个空间都改道、改名不重读文件且草稿
仍在、删除时脏页签先问、目录删除连子树关);`tests/native-surface.spec.ts` 新增
`path enumeration and the navigation gate`(枚举只含带路径的记录、插件侧改址扛得住
同修订重投、新修订仍按地址改回)。

复查后收紧(三支独立评审小队 + 自查收敛到同一处):

- `retargetedPaths` 的键由「tab id」改成「编辑器看到的那一侧会话 + tab id」
  (`pathTabKey`,写方与读方共用同一处定义):原生 tab id 每会话各自计数(`tab1`
  每个会话都有),只按 id 记键时两个会话的编辑器共用一个槽——其中一个(哪怕它自己
  的路径没动)在清理时会抹掉另一个尚未认领的移动,被抹掉的那个照旧重载、照旧丢草稿。
  同一键仍允许一个移动被认领多次(两个席位显示同一会话的文件时)。
- 生命周期补齐:`clear` 现在按细键生效,编辑器卸载时回收,删除关闭页签时也回收
  (原先只增不减:每次「改名没被已挂载编辑器认领」都会留一条)。
- `View` 记下 seat session:`pathTabs()` 不必再从视图键里拆 session,`retain()` 也
  不再重复同一份拆分(键只是内部编码,不该被别处解析)。
- 子树尾段改用 `paths.ts` 的 `relativeTo`(分隔符与大小写口径与全仓其它相对路径
  统一;原先手写的 slice 在旧路径带尾分隔符或大小写不同拼写时会算错);顺手删掉
  一条与既有用例重复的回归用例(`native-surface.spec.ts` 既有的「同记录二次
  ensure 且无 revision 时 path 跟着走」已经钉住同一事实)。
- **两种路径拼写**:聊天文件链接打开的页签,`path` 来自地址,而 `fileAddressFor`
  在工作区内一律写相对拼写(`src/a.ts`);文件树改名给的却是绝对路径。最初按原样
  比较,这类页签(正是默认打开方式)会整条判成「无关」,仍绑在刚被改名掉的旧名字
  上。现在比较统一在「按会话 cwd 解析后的绝对拼写」上进行,写回记录时用调用方给的
  新名;`movedPath` 的相等判断改用 `relativeTo` 的 `.`(字符串相等在 `E:/a` 与
  `E:\a` 混拼时会把 `新名/.` 写进记录)。
2026-10-10 22:19:07 +08:00
Menghuan1918 de1e76e2f5 feat(sidebar): 后台激活的页面不再顶掉读者,改为标记未读红点
维护者在 #817 上批准了「后台自动激活不接管右侧栏」的行为,并要求同批补上
「后台新开了页面」的提示:事件不能丢,但也不能把读者正在看的页面顶走。

行为:
- 被门控跳过的那次激活仍然创建任务管理页,只是不再抢焦点
  (`OpenTabSeed.reveal: false` → 宿主 `revealIfOpened: false`,即
  「放置但不聚焦」;页面类型本来就没有自己的聚焦路径,已经存在的页面
  再开一次也只是一次聚焦,正是门控要拒绝的那件事)。
- 该页在原生右栏芯片与插件底部工作台对应页签上显示一个静态小红点
  (`aria-label` = 新词条 `tabUnread`,颜色取既有 `--dsw-alias-danger`)。
- 读者切到该页即清除标记:底部工作台走 service.activateTab;原生栏的
  点击插件看不见(`ISidebarRight` 只有 `active()` 读取器,没有选中事件流),
  所以由宿主自己的芯片按 `tab.visible` 清除——非可见芯片不清除,
  否则宿主为每个展开页签都画标题,红点刚亮就会被抹掉。
- 标记存进会话状态的 `unread: TabType[]`(随布局持久化,跨挂载/跨会话/
  刷新都在),两个承载面读同一份,不会各自为政。

文案:20 份词典同批更新两条设置项描述(门控行为变了)+ 新增 `tabUnread`
词条(ja 真日文)。

测试:`tests/sidebar-auto-activation.spec.tsx` 的门控两条改为断言
「页面仍创建 + revealIfOpened:false + 标记出现」,并加红点生命周期与
「已在任务页/正常激活不标红」三条;新增 `tests/native-tab-unread.spec.tsx`
钉住原生芯片这一承载面(画点、按 visible 清除、非可见不清除、别的类型
不串味、不破坏可访问名)。判别性用 6 处镜像还原逐条证伪(见报告)。
2026-10-05 23:03:40 +08:00
HuanLinOTO ea76981c0e Merge PR #697: fix(native): 跨会话打开改为排队到上屏重放(Fixes #694)
# Conflicts:
#	src/client/native/surface.ts
2026-10-01 17:13:47 +08:00
HuanLinOTO 86ec5ccc75 Merge PR #736: fix(native): focus through the controller on surface.activate; carry meta on close
# Conflicts:
#	docs/external-plugin-guide.md
#	src/client/native/surface.ts
#	src/client/service.ts
2026-10-01 17:12:53 +08:00
ymac d1c8208d56 Merge origin/main (v0.24.1, DSH 0.2.0-rc.1) into fix/native-tab-state-retention
Two conflicts, both in the native tab adapter's per-session work — main's
`5c95002` moved the expansion set into the plugin store's session state while
this branch moved the RECORD identity to `sessionId::tabId`:

- `src/client/native/tab-adapter.tsx`: keep main's store-backed expansion as
  the authority (`attachStore` / `syncExpanded` / `getSessionStates().expanded`)
  and this branch's seat-scoped identity (`views` keyed `sessionId::tabId`,
  `get/has/update/drop/versionOf/retain` take the seat session). `toggleExpanded`
  keeps main's active-`reduce` / background-`reduceFor` split, but locates the
  record by its seat and writes the SCOPE session's set — the set every view of
  that session mirrors.
- `tests/native-surface.spec.ts`: main's five expansion cases adapted to the
  session-scoped API (seat session on `ensure`, two-arg `get`/`drop`, seat on
  `toggleExpanded`); the branch's cases now bind a store before toggling, since
  expansion no longer lives in the record itself.

The `files` takeover guard and its registration invariants come from
main; this merge drops the branch's duplicate.
2026-10-01 16:37:35 +08:00
Menghuan1918 ee1fe05067 feat(sidebar): 菜单层级/性能 + 选中条吸底 + 打包进度 + 修复「在侧边打开」
用户实测反馈 5 条:

1) 文件列表性能 / 右键菜单不再刷屏(先测量后改,探针 tests/file-tree-menu-perf.spec.tsx)
   - 宿主应用列表按路径缓存:N 次打开菜单只请求 1 次(原每次 1 次 + Loading 帧)
   - 行上的 git 数据改为原始值(tone/letter):共享 store 每次轮询重建对象不再触达行
     (探针:开窗 folderIcons 4 → 0;root 行也 memo 化)
   - 菜单开关不触发目录重列(fsTree=0);实测「菜单打开期间暂停轮询」会让变更行瞬时
     掉色并多两次重渲染,故按测量结果放弃该做法(数字与理由写进探针注释)

2) 「已选择 N 项」条移到底部:滚动容器最后一个内容子节点 + sticky bottom(不遮最后
   一行),窄栏 flex-wrap 换行不出横向滚动条

3) 菜单层级重构:一级只留默认动作(宿主默认应用 / 打开方式 ▸ / 在文件管理器中显示 /
   新 Tab / 在侧边打开 / 下载 / 压缩并下载 / 复制路径 / 重命名 / 删除;目录行另有
   新建文件夹、上传到此处),应用列表整体收进「打开方式」子菜单;宿主探测到本机关联
   应用时默认不显示插件自研 open-with 项目,新增设置开关 openWithPluginTargets
   (editor descriptor 的 pluginToggles)可强制并存;宿主不可用时插件项目照旧

4) 压缩并下载显示进度:宿主改为可观测任务(archive.build / archive.status /
   /sidebar/archive?id=,4 并发 + 5 分钟 TTL + sessionId 绑定,buildZip 逐条目
   onProgress),客户端轮询 250ms 显示「正在打包 done/total · N%」,ready 后 blob 下载,
   失败进 zipFailed

5) 修复「在侧边打开没有效果」:根因是它只写插件底部工作台(原生右侧栏的 tab 不在
   bottomSplits 里),现按承载面分流 —— 原生 tab 走 service.openTab(target:'side') →
   宿主 openResource(preferNewPane, revealIfOpened:false) 真正分栏;底部工作台行为不变
   (接入 API 变更已同步 docs/external-plugin-guide.md)

验证:typecheck / lint / test(135 文件 1461 通过)/ build 全绿;
DSH_CMD='npx -y --package @deepseek-ai/dsh@0.1.7-rc.1 dsh' pnpm test:mount 7/7 通过;
新增/更新测试:menu-perf(3)、archive(10)、open-in-app(18)、open-with(10)、multiselect(9)、
zip(37)、service(64)、editor-host(11)、builtins(23)、locales(20)
2026-09-28 20:11:46 +08:00
gyixuan 9489f41068 fix(native): focus through the controller on surface.activate; carry meta on close
surface.activate() only returned records.has(tabId) without focusing, so
external plugins with multi-instance native tabs (dsh-sidenote's side
chats) could never bring an existing tab to the front programmatically.
Focus via ISidebarRight.focus (dsh >= 0.1.5), which focuses the tab and
its pane.

surface.close() now also returns the record's meta so service.closeTab
can hand it to descriptor.onClose — native closes previously dropped it,
leaving meta-driven lifecycle consumers (e.g. recently-closed records)
starved.
2026-09-28 14:32:50 +08:00
ymac 7cf962652e fix(native): key a tab record by (session, tab id), not the bare id
Native tab ids restart in every session (`tab1`, `tab2`, …), and DSH 0.1.7
keeps a visited tab body mounted across hiding, tab selection and Session
switches, so several sessions' same-named tabs are alive at once. The
plugin's registry was a single-keyed map, which made the entering session's
body adopt the leaving one's record — and the leaving body's unmount cleanup
then delete it. The visible result was #636: after a conversation switch the
explorer stopped responding entirely (no request sent), in both directions.

Records are now filed under `sessionId::tabId`, and the seat session is
carried explicitly instead of inferred:

- `createNativeTabRecords` takes the seat session on `ensure`, and
  `get/has/update/drop/toggleExpanded/versionOf` all take it too;
  `retain(sessions)` reclaims the records of sessions that are gone;
- the title slot gets its own seat `sessionId` — the chip is drawn BEFORE
  the body, so it used to read whichever record the live slot happened to
  hold (another conversation's title on the switch frame);
- `SidebarSurface.update/has/activate` take an optional `sessionId`: with
  one, it names the session; without, the mounted seat answers, a unique
  match still resolves, and an id that names a tab in several sessions
  resolves to none rather than guessing (writing into another conversation
  is worse than refusing);
- `BetterSidebarService.updateTab` forwards it, and the six call sites that
  know their own scope (EditorHost, SideChatView, ChangesTab,
  tree-mutations) pass theirs.

Tests (native-surface.spec.ts, +8): per-seat-session identity (same-named
tabs stay apart, a patch/drop hits exactly one session, `retain` reclaims),
and surface resolution (explicit session wins, mounted seat is the
fallback, an ambiguous bare id is refused, close plus dead-session reclaim).
Each is red without this change.
2026-09-28 11:27:50 +08:00
Menghuan1918 6586e3e2d3 feat: adapt to DSH 0.1.7-alpha.1 and yield the read-only previews
DSH 0.1.7-alpha.1 is 1299 commits past 0.1.6-alpha.2 and rewrites four
contracts this plugin was built on. The peer floor moves to
^0.1.7-alpha.1 (semver's prerelease rule means ^0.1.6-alpha.2 can never
match a 0.1.7 prerelease); 0.1.6-alpha.2 and earlier stay on v0.19.1.
Released as 0.21.0-alpha.1 (dist-tag alpha).

Hard breaks:
- dsh-settings was rewritten: register(ns, schema) is gone, a form is
  addressed by the plugin row's Loader entry id and read from the
  module's exported Config. The preferences are merged into Config and
  marked volatile — which requires DSH's own schemastery, because only
  that build wraps a volatile field in the cosmokit reference the
  loader's volatile commit walks. With the public package a settings
  write reports success and revision 1 while the effective value never
  changes.
- ui-primitives renamed its whole icon family (IconXxx14/16 ->
  IconXxxRegular/Medium): 26 imported symbols, 17 files. The failing
  mode is render-time, not load-time. Five call sites that relied on the
  old 14px default now pass size={14} explicitly.
- Session format v4 rejects source.kind === 'plugin'; the side-chat
  boundary injection now writes plugin:dsh-better-sidebar, the same kind
  DSH's own v3->v4 migration produces, so historical threads survive.
  Tool results moved to role 'tool' with top-level content/isError; all
  four parsers accept both shapes.
- The client session snapshot dropped subagentsByParent/jobsBySession
  and the on-demand subagent-catalog observation API. The Tasks page
  reads projectionsBySession and a new jobs.list route.

Yields and convergence:
- The read-only previews go to DSH's documentpreview (Office->PDF, a
  spreadsheet worker, zoom, per-directory refresh); editor.canOpen
  refuses those 26 extensions. Markdown, HTML (with its sandbox
  switches) and the editable code buffer stay.
- The host browser kind is desktop-profile-only now, so the web e2e
  lanes expect no browser entry and assert its absence.
- Link takeover claims only urlTarget links and passes the rest to the
  host, fixing a regression from the 0.1.6 round: the fallback pointed
  at a 'browser' type the plugin no longer registers, so http links in
  its own markdown did nothing.

Also fixed, found along the way:
- The file tree refreshes live (new directory watch over the plugin's
  own socket), since the plugin owns the `files` kind.
- ctx.sessions.list has no `current` field at either tag; the three
  readers were dead. They now use ctx.sidebarRight.mounted.
- package.json.files was missing lib/client-locale.js.
- Two genuinely dead call sites: sessions.openSubagent/open/
  refreshSubagents do not exist on the current baseline, so the
  topology click, the jump-back and the retry were all no-ops.
- The test harness window shim lacked addEventListener, which the 0.1.7
  primitives call at module-evaluation time; and the e2e token exchange
  needs Playwright's request stack, not Node's fetch.
2026-09-22 17:09:08 +08:00
xiaochaZ f74b60aa37 fix(native): 跨会话打开不再交给 openTabIn(),改为排队到上屏重放
对"本页从未显示过"的会话调用 openTab/openResource 时,打开会被静默丢弃:
runtime 只在该会话挂载过之后才 adopt 它的 rightbar store,而
openTabIn()/openResourceIn() 对这种会话是静默 no-op(不写、也不回报),
place() 却无条件 return true,于是 entry 永远进不了 pending,
flushPending() 也就永远不会重放它 —— 与模块头注释和指南 §0 承诺的
"目标会话未挂载时排队到上屏重放"相反。

- place() 对非在屏会话不再调用 openTabIn()/openResourceIn(),直接 return
  false 让 entry 入队,由既有 flushPending()(已订阅 session list)在该会话
  上屏时重放;在屏会话的路径不变
- 同步模块头注释与 NativeController 的成员说明(那两个面保留为将来宿主
  返回 boolean 时的接缝,closeIn 仍在用)
- 新增 tests/native-surface-cross-session.spec.ts 锁定该契约

关联 #694
2026-09-16 23:15:53 +08:00
Menghuan1918 51546f7433 feat(native): render the plugin's tabs in DSH's native right Sidebar
Phase 2 of the 0.1.5 adaptation: the plugin stops drawing its own right
panel and contributes tab TYPES to DSH's native right Sidebar, which owns
the right column. The bottom workbench (terminal dock) stays plugin-owned.

Registrations (src/client/native/):
- every TabDescriptor becomes a native tab type (kind = descriptor.id, the
  default `extension` band) plus a keyed body in `sidebar.right.pane.tab`
  and a live chip title in `sidebar.right.pane.tab.title`
- the `editor` type also claims `dsh-resource://file/**`, so it outranks
  the built-in `text` preview (fallback) and every file the product opens
  lands in the plugin's editor
- the built-in `files` page kind is TAKEN OVER by an extension
  registration of the same kind: `openTab('files')` draws the plugin's
  explorer, and the built-in resumes when the plugin unregisters
- registrations follow the plugin registry + the side-card settings: a
  type registered later (external plugin) gets its native type too, a
  disabled type is unregistered (absent from the guide, refuses opens)

Adapter (src/client/native/tab-adapter.tsx):
- one synthetic plugin `SidebarTab` per native tab id, minted from the
  native record + navigation params (or the descriptor's own createTab,
  which a native guide open bypasses), kept live across navigations and
  updateTab writes
- the explorer's per-tab expansion/reveal sets and the per-kind instance
  counter, which the plugin's own layout used to hold

Service routing (src/client/service.ts):
- `setSurface` installs the native write face; openTab/openFile land
  natively (a path becomes a resource address, a path-less editor open
  becomes the `files` page, the rest carry the seed as navigation params),
  closeTab/updateTab/activateTab recognise native tab ids
- new optional `OpenTabSeed.target` ('right' default, 'bottom' keeps the
  bottom workbench); the bottom panel's own + menu and auto-terminal pass
  'bottom'
- src/client/native/surface.ts probes the controller's per-session writes
  (`openTabIn`/`openResourceIn`/`closeIn`, not in `ISidebarRight`) and
  queues opens for a session whose surface is not mounted yet

Right panel retired behaviourally (Phase 3 deletes the code): Sidebar
renders its bottom workbench only, keeps the panel collapsed, and hides
the right-panel toggle. The panel-specific e2e specs are removed; the
mount lane now drives the native guide (tab sweep), the plugin explorer
inside the native pane (editor/mermaid/README chunks) and the sidechat
host routes.

Verified: pnpm typecheck / lint / build / test (126 files, 1349 tests) /
check:consumer-types, plus pnpm test:mount against a real
@deepseek-ai/dsh@0.1.5-alpha.1 host (7/7).
2026-09-09 11:47:31 +08:00