Skip to content

feat(chatroom): persisted sessions + sidebar#392

Open
patschmittdev wants to merge 2 commits into
feat/chat-polishfrom
feat/chatroom-sessions
Open

feat(chatroom): persisted sessions + sidebar#392
patschmittdev wants to merge 2 commits into
feat/chat-polishfrom
feat/chatroom-sessions

Conversation

@patschmittdev

Copy link
Copy Markdown
Collaborator

What

Persisted, named chatroom sessions (storage + IPC + sidebar) plus a refactor splitting the ChatroomPanel god file into components. Split off feat/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)

  • File-backed under userDataDir/chatroom-sessions/: one JSON per session + an active.json pointer. Stores transcripts + task ledger only (no credentials). One-time idempotent migration from the legacy single-transcript layout. Store owns persistence + id assignment; ChatroomService owns transcript mutation.

New IPC (apps/desktop/src/main/ipc/chatroom.ts)

  • Thin adapter; all inputs validated with zod (message non-empty, roundId bounded, orchestration config as a strict discriminated union). preload.ts exposes the session API.

Renderer

  • ChatroomSessionPanel + ChatroomSessionPicker sidebar; ChatroomPanel god file split into ChatroomMessageList/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 sessionId path handling in the store.

Stack

refactor/ui-foundation #389
 └─ chat-polish #391
     └─ chatroom-sessions (this)

Validation

  • npm run lint -- green (tsc, eslint, dependency-cruiser, yaml, md).
  • Tests -- 184 passed (8 files: ChatroomService, ChatroomSessionStore, sessions, IPC, ChatroomPanel, OrchestrationDiagram/Picker).

Mount of ChatroomSessionPanel into AppShell is deferred to the final integration PR, per the stack's design.

Patrick Schmitt and others added 2 commits June 7, 2026 11:38
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant