Repository navigation
improve(ui): make session switching and transcript rendering faster - #129834
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 25, 2026, 11:47 PM ET / August 26, 2026, 03:47 UTC. ClawSweeper reviewWhat this changesThis PR optimizes Control UI session switching, sidebar updates, and transcript rendering while avoiding persistence writes for sidebar-only visibility changes. Merge readinessKeep open: the new lineage index is discarded before lookup, so alias and case-variant session routes still scan the full roster instead of using the intended fast path. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe Control UI receives Gateway session state and projects it into sidebar navigation and chat panes. Session keys identify lineage rows, which are then rendered with transcript and split-layout state in the browser. flowchart LR
A[Gateway session roster] --> B[Lineage row collection]
B --> C[Session key lookup]
C --> D[Sidebar navigation]
E[Transcript events] --> F[Transcript projection]
F --> G[Chat panes]
D --> H[Control UI rendering]
G --> H
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource -7, Tests +56. Total +49 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep normalized keys through collection and normalize direct lookups and described-row inserts, then prove alias routes take the indexed path without changing session identity semantics. Do we have a high-confidence way to reproduce the issue? Yes, from source: the added main-alias scenario reaches a raw-key map miss and then the existing full-map equivalence scan. The checkout is read-only, so this review did not execute the focused test. Is this the best way to solve the issue? No. The optimization must preserve canonical keys at both collection and lookup; rebuilding the map with raw keys defeats the intended fast path for aliases. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 345cfde43dc9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Session switching, sidebar interaction, and transcript rendering perform repeated work that grows unnecessarily with the session roster and message history. Collapsing the sidebar also rewrites persisted settings even though visibility is deliberately local to the current UI instance.
Why This Change Was Made
Index session lineage by the existing canonical session-identity contract instead of repeatedly scanning every known key; preserve main-session aliases and case-sensitive Matrix/Signal identifiers. Keep split-layout reads immutable without cloning their entire column, avoid irrelevant connected-title/outbox and roster projections, persist navigation settings only when an actually persisted preference changes, and build transcript/reply rows in their existing owner passes. Ordinary Markdown now skips block-art and disclosure processing when its required glyph/tag cannot possibly be present. Narration and sidebar categories are filtered/deduplicated before sorting.
Production code: +89/-96 (net -7 lines). Regression tests: +59/-3.
User Impact
Sessions open and switch more responsively, particularly with larger rosters or long streaming transcripts. Sidebar collapse no longer serializes and rewrites unrelated stored preferences. Existing navigation aliases, offline queued counts, Markdown details/block art, split-pane ownership, and reply navigation remain unchanged.
Evidence
Tested against a real isolated, loopback-only development Gateway serving the production-built Control UI, with 60 actual Gateway-backed sessions; Chromium alternated between the same session rows 18 times and discarded the first two warmup samples.
Isolated owner microbenchmarks show why the same changes scale beyond the 60-session browser fixture: canonical lineage collection improves from 85.22 ms to 0.27 ms at 600 sessions, ordinary Markdown block-art classification from 45.46 ms to 0.28 ms across 12,000 calls, and ordinary streaming-tail repair from 312.46 ms to 3.71 ms across 300 calls. These are component measurements, not claims about end-to-end latency.
Both newly fixed ownership violations were reproduced with failing tests before the implementation: connected document-title rendering must not summarize stored outboxes, and visibility-only navigation changes must not publish persisted-settings changes. Focused owner/sibling validation: 315 passing tests. Chromium end-to-end validation: 30 passing tests across session stability, retained-pane hydration, sidebar toggling/presentation, and streaming runtime budgets. Production UI build also passes its startup-size and request-count gates.
Before (synthetic fixture data only):
After (synthetic fixture data only):
Real development Gateway session-switching recording:
control-ui-live-session-switching.webm