Client: keep more than one session live at a time (multi-pane conversation rendering) #6631
icesword0760
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.
What I ran into
I'm building an external layout plugin that renders several conversations side by
side — each pane a complete session with its own transcript, composer and approval
flow.
The client stage is a single watched id that follows
list.current(
packages/api/session-controller/src/client/sessions/service.ts), so exactly onesession's event window is open at a time. Non-current panes fall back to the current
binding and show the wrong transcript. That file's own module comment already
reserves this evolution — "the staged state can widen to a multi-pane list later" —
which is what led me to try it.
What I did locally
Three small changes, kept deliberately additive:
session-controller(client) — widen the stage from a single watched id tocurrent ∪ pinned. NewISessions.pin/unpin/stagedandSessionListState.staged;pruneScopes/sweepDeferreddecide by set membership.open()still moves thesingle selection, so the selection stays single —
stagedis a projection forrenderers, not a second selection.
ui-slots/ui-session— an optionalSlotScopeAdapter.observe?(key): anobservable over one session's materialized binding, so a subtree rendered against a
pinned, non-current session never holds a stale binding.
ui-slots/ui-renderer—RenderOpts.sessionKey/SessionAreaProps.sessionKey, binding arenderSlotsubtree to one sessionidentity instead of the current selection. Prefers
observewhen installed, fallsback to
resolve(); an unknown key falls back to the current binding.Single-stage behaviour is unchanged. With nothing pinned,
current ∪ pinnedreduces to
currentand every existing path behaves exactly as before. Both renderingadditions are optional and fall back to today's behaviour when absent.
Verification
Rebased onto
0.1.5-rc.2.tsc -b tsconfig.client.jsonis clean and the fullworkspace suite is green: 412 test files, 6110 tests.
38 files change. Eight are source — seven product files plus one test-support double —
and the remaining thirty are test fixtures picking up the three new interface members.
Four new unit tests cover the keyed scope, keyed rendering and keyed observation. To be
straight about the gap: the staged set itself (
pin/unpin) is currently exercisedonly through the existing stage-lifecycle tests, not by dedicated ones.
Why I'm posting instead of opening a PR
CONTRIBUTING says external PRs aren't being accepted right now — understood, no
problem. I'm posting in case the capability is interesting to the team, and so other
plugin authors hitting the same wall can find this thread. Happy to share the patch
series if that's useful.
The ask
Some way for a plugin to keep more than one session's event window open. The shape
above is just what worked for me; anything that lets a renderer bind a subtree to a
session other than the current selection would solve it.
All reactions