Repository navigation
perf(control-ui): keep the session header steady during reload - #190096
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesReserve the desktop session-menu button’s space before its session descriptor arrives. Example: Reload the cached Observatory report dashboard with 200 newer sessions outside its archived descriptor.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open as a useful, explicitly paused experiment. The focused patch addresses a remaining header shift on current main; no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI header combines cached conversation identity with live session actions; its stylesheet determines geometry while existing session owners determine menu availability. flowchart LR
A[Cached conversation] --> B[Desktop header]
C[Live session descriptor] --> D[Existing session menu]
D --> B
E[Shared button size] --> F[Reserved menu slot]
F --> B
Technical reviewBest possible solution: Keep the existing header and menu owners, reserving the trigger’s dimensions entirely in their shared desktop stylesheet. Do we have a high-confidence way to reproduce the issue? Source confirms that the desktop container has no reserved width before the live menu arrives, matching the supplied current-main measurements and reported baseline regression failures; no target code was executed during review. Is this the best way to solve the issue? The patch is the smallest complete repair: reserve the existing container, reuse the button size, and extend the existing two-route geometry regression without adding runtime state or changing menu authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c2bbb1059f85. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +13, Other +2. Total +20 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 1, 2026, 1:28 AM ET / 05:28 UTC. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
645b7e4 to
dd0cd0f
Compare
…aw#190096) The desktop chat header now reserves the session menu's 32 px hit area before the session descriptor and connection arrive. Previously the trigger was hidden while disconnected and inserted around 700-870 ms into a warm reload, pushing the header trailing controls sideways by 32 px; offline panes now keep the same header geometry as connected ones. The header icon size is a single custom property shared by the icon buttons and the reserved slot. The native two-route reload regression now covers an archived descriptor outside the bounded cached roster. Proof: 11 interleaved AWS pairs per route plus A/A: header movement 32 to 0 px, stable in 11/11 on chat and dashboard, snapshot bytes unchanged, CLS improved, other timings within A/A. Runtime +5 LOC (CSS). The one red PR check is an unrelated Bun-shard timing poll in chat-effort-picker.browser.test.tsx that passes in isolation on the exact head and on main's identical shard plan.
What Problem This Solves
Fixes a 32 px header movement when reloading a cached chat or dashboard deep link whose session descriptor falls outside the bounded sidebar cache. The campaign evidence originally recorded 14 visible states on a signed-in dashboard deep-link reload. After #189760 fixed admission of the cached breadcrumb and archived footer, the remaining movement comes from mounting the session-menu trigger when the session descriptor or connected pane actions become available.
User Impact
The cached desktop header keeps its final geometry while the live session menu becomes available. Mobile retains its existing presenter.
Why This Change Was Made
The transcript snapshot can be admitted before the live session descriptor or connected pane actions.
chat-pane-header.tssupplies the row-based menu;chat-pane-mobile-composition.tsxalso admits connected pane-local actions. There is no separate actions-list RPC. The menu's empty desktop container previously occupied no space; mounting its button later grew it by 32 px. Reserve the button's hit area using the same size token as the real trigger. Both dimensions matter: width alone still lets the empty container move vertically when the button arrives.Menu contents and live authorization remain with their existing owners. No cache, configuration, protocol, server-state or snapshot fields change. Connect-first is preserved.
Evidence
Final head:
dd0cd0fb7b77e9276447a3ff9ce72ce03f1f6026; baseline runtime: mainc2bbb1059f85c3fe542e1f6620dea0e6bd4f18b2.Quiet AWS lease
cbx_6ebca0a903bf, fixedc7a.4xlarge, 16 observed CPUs, approximately 30.6 GiB RAM, Node 24.19.0 and repository Playwright Chromium. One box ran 11 interleaved A/A pairs and 11 interleaved baseline/candidate pairs per route, unprofiled, Team-scale fixture,live-fastlatency. Synthetic settings match the reported shape: involving-me, category grouping, created sort, preview disabled, 97 groups, 102 section-order entries, five collapsed sections, empty groups always, pins and an archived selected session.Primary passes: 11/11 stable candidates on each route, versus 0/11 baseline. Every candidate has zero trailing-region, menu-container, breadcrumb and archived-footer movement from the first app header sample through live updates. CLS improves in all 22 pairs. Snapshot sizes are exactly unchanged in every candidate pair: chat 52,234 B and dashboard 51,915 B. All 88 A/A and candidate reloads have one connect and zero non-connect requests before hello.
Runner:
scripts/bench-control-ui-cold-load.tswith warm reload, archived session, pane-chrome probe and two bundle directories; dashboard adds--chat-dashboard-route.Predeclared gate: movement at most 1 px in at least 10/11 candidates per route; no footer contraction or snapshot-size growth; secondaries judged against A/A and the campaign's paired regression rule. Available metrics show no regression. Chat native-row paired median is +4 ms (5 better, 6 worse), exactly the A/A paired median; dashboard sampled-row paired median is +1.2 ms (4 better, 7 worse), versus A/A +8.7 ms. Their IQRs overlap. These small changes are noise, not claimed improvements.
Instrumentation gap: dashboard cached text is visible but emits no native Element Timing in either arm. Its native first-text-paint time is unavailable; DOM/rAF visibility is shown separately and is not claimed as paint. Final rows below use the bench's first live transcript publication milestone.
All times below are ms; brackets contain Q1 and Q3. Hello handled is the microtask after connected publication; first live rows is the native live transcript publication. DOM/rAF visibility is reported separately from text paint. Dashboard cached text is visible but emits no native Element Timing on current main or candidate; its native paint time is unavailable.
Candidate minus baseline: all per-pair deltas
chat:
dashboard:
A/A second minus first: all per-pair deltas
chat:
dashboard:
Validation
The existing native two-route regression fails on the baseline for the expected 32 px shift and passes with this change. It asserts the real trigger is absent before hello, then waits for that trigger before comparing geometry. The 200 newer sessions keep the archived target descriptor outside the bounded boot roster, so a small fixture cannot mask the late-menu case.
pnpm test ui/src/e2e/chat-header-connection.e2e.test.ts --maxWorkers=1: 2 passed, 17.45 s wrapper wall time locally; final-head AWS replay also 2 passed.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=2: 880 files passed, 6 failed, 3 skipped; 3,356 tests passed, 2 failed, 17 skipped. Four failed suites could not launch because WebKit was missing. After installing the repository's WebKit, all four passed individually on the unchanged head:logs-scroll(3),tooltip-first-activation(2),chat-composer-picker-layout(4),workboard-native-bundle(4). No test was skipped or weakened to repair setup.Current-main controls used
627523800213cda34b1fb64d73eb64ff21382bacon AWS leasecbx_3aa041f87b9d(c7a.4xlarge). All six e2e control files and the composer-focus test are unchanged from the measured base. The original CI shard plan retained its inventory, Node/Bun partitioning, three workers and two-CPU affinity: 738 files / 8,281 tests passed.chat-outbox-migration.e2e.test.ts:71extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts:315AWS proof: final-head measurements and full suite, candidate lint and repaired WebKit files, main shard/outbox controls, remaining main controls. A host network interruption ended the first main-control transport after the completed shard/outbox results; its artifacts and signed terminal history were recovered, and only unfinished controls resumed at the same pinned main SHA. Both leases are released and verified to have no host. No local Gateway was started.
Review and CI
Autoreview of the complete lane diff is clean through P2. The patch is identical after the mechanical rebase. ClawSweeper found no actionable source defect and requested controlled comparison proof, supplied above. The exact-head code review completed with no findings.
Exact-head CI run 41277954346 remains red only for
checks-ui (3/3)and its gate aggregation. All seven selected UI e2e shards and CI lint checks pass.The failed case is
chat-effort-picker.browser.test.tsx:186, keyboard reopening/focus: the assertion captures a null expected slider before lazy content exists. This is consistent with a fixture-readiness race. The unchanged standalone composer fixture has no header for the changed selectors to match. The original shard plan passes on current main (738 files), and the failed file passes on the exact head in isolation (7 tests, 1.72 s Vitest duration). This CI failure is unreproduced in those controls, not claimed as a confirmed main failure. CI was not rerun to chase green. Maintainer review should retain this qualification.Production LOC
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*': 9 insertions / 2 deletions = +7. Per file:ui/src/styles/chat/startup-layout.cssconfig/test-lines-allocations/header-session-menu-slot.txtui/src/e2e/chat-header-connection.e2e.test.tsNo new store, component, test suite, production helper or config option. No changelog edit; release-note context is the cached-header stability fix described above.
Synthetic before and after
Baseline cached frame before menu arrival, and candidate after arrival with its reserved geometry. These are sanitized synthetic fixtures; no private captures are included.