feat(chatroom): persisted sessions + sidebar#392
Open
patschmittdev wants to merge 2 commits into
Open
Conversation
Split the chatroom sessions feature out of feat/webgl-ambient-background. Stacks on feat/chat-polish (ChatroomPanel renders MessageActions + the polished StreamingMessage) and absorbs the SVG OrchestrationDiagram (ChatroomPanel renders it, so the two are inseparable in source). - ChatroomSessionStore: per-session transcripts under chatroom-sessions/, an active-session pointer, and a one-time legacy chatroom.json migration - ChatroomService: session lifecycle (create/resume/rename/delete/list) over the store; 500-message cap + debounced ledger persistence retained - ipc/chatroom: session channels wired through preload + browser shim + helpers - renderer: ChatroomSessionPanel (session list), OrchestrationPicker, TaskLedgerPanel, ConversationHistoryPanel (grouping + resize), OrchestrationDiagram (SVG over the pure model), ChatroomPanel session wiring - store: chatroomReducer session actions + chatroomSessions/activeChatroomSessionId - HandoffStrategy: loop-guard relaxed to allow a single hand-back (A->B->A), max-hops still enforced -- flagged for orchestration-safety review per AGENTS.md Fold-in (audit P2): restored the cap / ledger-debounce / malformed-disabledMindIds coverage that was dropped in the sessions refactor. The behaviors live in ChatroomService.persist/schedulePersist; the new tests exercise them through the real-fs session store (cap via legacy migration + broadcast, debounce via on-disk transcript observation under fake timers). Scope notes: the AppState.previousView field + lifecycleReducer back-button change are intentionally left for shell-theming (they are lens-navigation, not chatroom). The ChatroomPanel god-file split lands in the next commit on this branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract the 12 sub-components + helpers out of the 1066-line ChatroomPanel.tsx into their own colocated files, leaving ChatroomPanel as orchestration only (1066 -> 382 lines). No behavior change: ChatroomPanel.test.tsx (20 cases) and the full chatroom component suite (58) stay green. New files: - chatroomScenarios.ts (DemoScenario + DEMO_SCENARIOS) - chatroomModerator.ts (profileDisplayName, parseModeratorJson, isModeratorMessage) - ParticipantBar, ModeratorDecisionBubble, TypingIndicator, CollapsibleMessage - ChatroomMessageRow (+ ChatroomMessagePresenter), ChatroomMessageList - MetricsSummaryCard, ChatroomHydratingSkeleton, ChatroomEmptyState - ChatroomSessionPicker Addresses the audit's P2 god-file finding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Persisted, named chatroom sessions (storage + IPC + sidebar) plus a refactor splitting the
ChatroomPanelgod file into components. Split offfeat/webgl-ambient-background, stacked on chat-polish (#391), which is on the foundation (#389).Contents (38 files over chat-polish)
Two commits:
feat(chatroom): persisted sessions + sidebar-- 26 files, +3522/-614 (the feature).refactor(chatroom): split ChatroomPanel god file into components-- 13 files, +729/-695.New persistence (
ChatroomSessionStore)userDataDir/chatroom-sessions/: one JSON per session + anactive.jsonpointer. Stores transcripts + task ledger only (no credentials). One-time idempotent migration from the legacy single-transcript layout. Store owns persistence + id assignment;ChatroomServiceowns transcript mutation.New IPC (
apps/desktop/src/main/ipc/chatroom.ts)roundIdbounded, orchestration config as a strict discriminated union).preload.tsexposes the session API.Renderer
ChatroomSessionPanel+ChatroomSessionPickersidebar;ChatroomPanelgod file split intoChatroomMessageList/Row,OrchestrationDiagram,ParticipantBar,TypingIndicator,MetricsSummaryCard, etc.;chatroomReducer+ state.Security note for review: introduces new file persistence + IPC. Storage path is the user data dir, no secrets persisted; IPC validates at the boundary. Worth a focused look at
sessionIdpath handling in the store.Stack
Validation
npm run lint-- green (tsc, eslint, dependency-cruiser, yaml, md).ChatroomService,ChatroomSessionStore, sessions, IPC,ChatroomPanel,OrchestrationDiagram/Picker).Mount of
ChatroomSessionPanelintoAppShellis deferred to the final integration PR, per the stack's design.