emrg: GUI per-session chat-view containers — P3 slice 2 (GUI multi-session rant P3) - #634
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-172123 (author). P3 slice 2: per-session .session-view containers with display switching; 153 GUI + 680 pytest green.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-173337
Verified locally on the PR head: GUI suite 153/153 (43 renderer smoke — activateSessionView creates distinct per-session .session-view containers under #chat-view and toggles .active (only the active view display:flex); unsid'd nodes route to the active session's container (fallback chain registered → active → legacy); Chat.clear targets only the active container (inactive view retained — switch-back shows original messages); targeted clear(sid); unregistered-sid events render into active view while state buckets stay keyed by own sid; test mock innerHTML setter now faithfully clears children), 680 pytest green, doc-count guard passes (153 = 43 dc + 17 cm + 43 renderer smoke + 22 + 15 + 7 + 3 + 3 synced in Agent.md/README/README.cn), node --check clean.
Code review: #chat-view becomes a positioning wrapper with .session-view absolute inset:0 scroll containers (display:none unless .active) — browser-tab effect preserves scroll/draft/tool cards/in-flight stream across switches; switchSession/newSession activate instead of Chat.clear(); deleteSession unregisters + removes the container; /clear and /rewind target the active session's container; updateEmptyState correctly counts the active view (not the wrapper). Exported activateSessionView for tests. Builds cleanly on #630/#632; matches the rant P3 plan (remaining: P3 finalize/event-routing cleanup, P4 open-sessions sidebar).
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260810-173604
Re-verified on head 8e573ec: GUI suite 153/153 (43 renderer smoke incl. new P3 s2 tests — per-session .session-view containers created/toggled under #chat-view, unsid'd events route to the active container, targeted clear(sid) isolation, unregistered-sid fallback with per-sid state buckets), 680 pytest green, CLI import OK, node --check clean. Doc-count guard synced (153 = 43+17+22+43+15+7+3+3).
|
Tested this PR end-to-end on Windows — P3 slice 2 (per-session chat-view containers) verified. |
…at-view containers entry (#635) Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Summary
P3 slice 2 of the GUI multi-session rant (2026-08-10T15:07:19): per-session chat-view containers with display switching, building on P3 slice 0 (#630, per-session chat state isolation) and P3 slice 1 (#632, sessionsBySid state table).
Each open session now gets its own
.session-viewcontainer under the#chat-viewwrapper. Switching sessions togglesdisplay(browser-tab effect) — scroll position, draft state, tool cards, and in-flight stream are fully preserved.Changes
renderer/chat.js —
chatContainer(sid)fallback chain: registered container → active session's container (unsid'd events land in the active session, P4 transition) → legacy#chat-view.renderer/app.js
ensureSessionView(sid)/activateSessionView(sid): get-or-create.session-viewunder#chat-view, toggle.active(only the active view isdisplay:flex), register container (idempotent). Exported for tests.switchSession/newSession: activate the session view instead ofChat.clear()— switching away no longer destroys the other session's rendered state.deleteSession: unregister + remove the deleted session's container (if open)./clearand/rewind:Chat.clear(state.sessionId)— target the active session's container only.updateEmptyState: evaluate the active session's container (the wrapper always holds.session-viewchildren, so counting the wrapper would break the welcome screen).renderer/css/layout.css —
#chat-viewbecomes a positioning wrapper (position:relative; overflow:hidden);.session-view= absoluteinset:0scroll container,display:noneunless.active. Excluded.session-viewfrom the legacy#chat-view > *centering rule so the scroll container stays full-width (scrollbar at window edge); media-query padding moved to.session-view.test/renderer.smoke.test.js — +3 tests (container creation + display switching + unsid'd-node routing; targeted
Chat.clearisolation; unregistered-sid fallback with per-sid state buckets). Test mock:innerHTMLsetter now faithfully clears children on""(Chat.clear depends on it).Verification
node --checkclean on all touched JSPart of the staged P3 plan (remaining: P3 finalize/event-routing cleanup, then P4 open-sessions sidebar).