Proposal: three minimal seams to enable a multi-session split-pane community plugin (with working prototype) #2418
starsmaplee
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
We prototyped a multi-session split-pane UI for the DeepSeek Harness Web GUI (up to 4 panes: 2×2 / left-1-right-2 / side-by-side presets, per-pane session binding, persistence, empty-pane session picker reusing the sidebar's own session rows) by patching the published
0.1.0-rc.xpackages. It works and is validated by an 18-assertion real-browser E2E suite plus unit/smoke/render tests, with zero regression in single-pane mode.The pane logic itself is pure plugin-shaped code (registers into slots, injects
sessions/workspaces/locale/layout, ships its own locale NS). However, a community plugin cannot be distributed cleanly today, because three small capabilities are private to the core. This post proposes three minimal seams. Each is small, bounded, and generally useful beyond this feature (e.g., future side-by-side subagent viewing).Proof-of-concept archive (patches + docs + full test suite): https://github.com/starsmaplee/dsh-multi-session-panes-study
Seam 1 — Per-session binding provider (renderer)
packages/client/web-react(session-provider region, next to the existingSessionProvider); shell wiring inapps/web/src/main.ts.SessionProviderFor({ id, empty, children })that subscribes to a per-session provide cell and wraps children in the binding context (keyed remount on id change), and expose it from the shell as an official global (e.g.window.__DSH_SESSION_PROVIDER_FOR__).Seam 2 — Center-column slot seam (layout)
packages/client/ui-layoutroot registration (AppFrame); one conditional registration inpackages/client/ui-conversation.centerslot (kind: "single", scope: "root") and render it in the center column with a fallback:renderSlot("center", {}, { fallback: renderSlot("conversation", {}) }). The conversation plugin additionally registers intopane.conversationbehindctx.slots.inject("pane.conversation", …)(the existing wait-for-declaration pattern), so it activates only when a panes plugin declares it.conversationslot; plugins cannot take it over without forking the whole frame.Seam 3 — Two generic multi-session runtime capabilities
packages/client/runtime(SessionRuntime).provideInfoCell(id)— an observable per-session provide-bundle cell (snapshot falls back to the static no-session projection; notified on roster rebuilds and scope mint/drop), andadopt(id)— opens a session's history window without moving the current selection (resolve(id)+record.session.open(), idempotent).Evidence / feasibility
Ask
Either (a) adopt these three seams upstream so community plugins can build on them, or (b) give feedback on the approach so we can adjust the prototype before finalizing. Happy to provide the test suite and the plugin-shaped code as reference.
中文概述
我们通过在已发布的
0.1.0-rc.x包上打补丁,原型实现了 Web GUI 的多会话分屏(最多 4 窗格:2×2 / 左1右2 / 左右预设、每窗格独立绑定会话、持久化、空窗格会话选择器直接复用侧边栏行组件)。功能可用,并通过 18 项真实浏览器 E2E 断言及单元/烟测/渲染测试验证,单窗格模式零回归。分屏逻辑本身完全是插件形态;但社区插件目前无法干净分发,因为三个小能力是内核私有的。本贴提案三个最小缝隙,每个都很小、有界,且在此功能之外具有通用价值:
packages/client/web-react+apps/web/src/main.ts):导出SessionProviderFor({ id, empty, children })并挂到官方全局——让插件能把会话槽位树渲染在任意会话的作用域下。packages/client/ui-layout):声明center槽并以fallback: renderSlot("conversation", {})保持默认行为;conversation 插件经ctx.slots.inject("pane.conversation", …)条件注册。packages/client/runtime):provideInfoCell(id)(按会话订阅提供信息)与adopt(id)(不动当前选择地打开窗口)。可行性证据(补丁 + 文档 + 完整测试套件):https://github.com/starsmaplee/dsh-multi-session-panes-study
请求:(a) 采纳这三个缝隙,或 (b) 对方案给出反馈,以便我们定型。我们乐于提供测试套件与插件形态代码作为参考。
All reactions