Repository navigation
Conversation
Keep overscan out of categories below the viewport while retaining selected, focused, dragged, and menu rows. Prepare advertised-method membership once per catalog identity so refreshed capabilities and independent connections remain distinct.
|
🦞👀 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 changes before merge. What this changesThis PR skips sidebar overscan for sections below the viewport and prepares Gateway method membership once per catalog array. Example: A warm reload displays 97 sidebar categories, with five collapsed and a 600 px viewport.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open as a maintainer-owned, explicitly paused experiment addressing current-main rendering waste; the catalog cache also requires an existing test-fixture repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI receives session groups and Gateway method catalogs, then derives mounted sidebar rows and feature availability through existing presentation and access owners. flowchart TD
A[Gateway hello and capability refresh] --> B[Method catalog membership]
B --> C[Existing scope and connection checks]
D[Session groups and retained rows] --> E[Sidebar window geometry]
F[Sidebar viewport] --> E
E --> G[Mounted session rows]
Technical reviewBest possible solution: Keep both optimizations in their existing owners, update catalog-mutating fixtures to publish replacement arrays, and coordinate the overlapping sidebar change with the campaign lead. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically admits two rows from each entirely below-viewport expanded section; the body reports a matching red-before/green-after browser regression, which was not rerun during this read-only review. Is this the best way to solve the issue? The production changes are small and preserve existing ownership, retention, and access checks, but the new catalog-identity contract must also be applied to existing fixtures. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15d22ceb7c8f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +13, Tests +80, Other +2. Total +95 across 5 files. Added test files: 0. View PR surface stats
LabelsLabel 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 October 31, 2026, 5:58 PM ET / 21:58 UTC. |
L271: stop at the measurement gate
Do not merge. The real-Gateway chat first-text-paint gate missed: paired median −92 ms, 8/11 pairs better, versus the predeclared ≤−100 ms and ≥9/11. Native dashboard CLS also increased by 0.000253 with separated IQRs. Close this experiment draft; preserve the branch for the lead. This does not establish the complete cached-page campaign exit criterion.
Head:
d5380c837ffe97ea44a3733a93989550541be2dc. Experiment: #189786.What Problem This Solves
A grouped sidebar mounted overscan rows in every section below the viewport. With the operator-shaped fixture, roughly 140 session rows were mounted although only about 30 fit in the native viewport. Each mounted row also repeatedly scanned the full advertised-method catalog for connection-level facts. These costs consume time after transcript DOM exists and before its first text paint, even with cached JavaScript delivery.
Why This Change Was Made
The existing sidebar window owner computed an end index of two when the section's first row was below the viewport (
beyond === 0). It now gives that section an empty window. Selected, focused, dragged and menu-owned rows still use the existing retention path. Headers, logical spacer height, pagination and scroll behavior stay with the existing owner; there is no new staging or reveal gate.Method membership now uses a weakly held Set per advertised-methods array identity. Hello and capability refreshes replace that array; separate catalogs and replacement catalogs get separate prepared facts. Live phase/scope admission is still evaluated by its existing owner. This removes repeated linear membership scans without adding a second authorization owner. No Gateway protocol, durable shape, config option or product filtering change was made.
User Impact
The experiment substantially reduces mounted sidebar rows and long-frame blocking. It does not clear the lane's first-paint bar, and a tiny consistent native dashboard layout shift remains unexplained. Settled synthetic screenshots show matching visible layout, but they do not prove that every cached region paints completely in the first frame. A full visual audit of all offscreen rows/badges was not completed.
Evidence
All performance comparisons ran on the same quiet AWS c7a.4xlarge, lease
cbx_7a051eb464c4, with repo Playwright headless Chromium. Each harness/route used 11 alternating baseline/candidate pairs and an independent 11-pair A/A control. No performance result came from the shared Mac. CPU idle before the final visual run was 93.3%. Real-Gateway comparisons used synthetic 3,000-session data, archived chat/dashboard targets, three acknowledged live viewers, tall Markdown, and 80 ms RTT. Native comparisons used the Team-scale cold-load bench,live-fast, warm reload, archived session, pane-chrome probes, LoAF and RPC probes. Timed comparisons were unprofiled and omitted screenshot capture.Both fixtures used the operator settings: category grouping with 97 catalog groups / 102 section-order entries, created sort, five collapsed sections, involving-me, preview off and stored empty-groups mode
always. In the current projection that stored mode means always hide empty groups; native settled headers therefore number 71, not 97. This is the existing semantics, not a product change.The measured baseline runtime was
7b29a23da2a6e787eca43c757bbc489f83d5b682. Only diagnostic warm-reload tools were taken from fixture commit5e2a2b5eaf5109b82e40ef384b4c4928389d8879. Candidate UI differed by the two runtime modules in this commit. Final branch rebase baseb891e0d84b7fdiffered from the measured baseline only in six test/support files, with no production differences. SHA-256 hashes of both measured candidate modules match this head. Both arms used the same Gateway build; this is runtime-patch evidence, not a claim that the server bundle was built at this head.Values below are median [Q1, Q3], milliseconds except CLS and row counts. Paired delta is candidate minus baseline; medians of pairs need not equal differences of arm medians.
Real Gateway
Native operator bench
Real chat and dashboard LoAF blocking improved in 11/11 pairs. Real dashboard first text paint improved in 11/11 pairs. Real chat first text paint has overlapping IQRs and only 8/11 wins; its result cannot pass the declared bar. Real chat hello-handled has a +16.4 ms paired median with 6/11 worse and overlapping IQRs; the A/A control is similarly noisy, so this is not a demonstrated regression under the campaign rule. Native dashboard CLS has separated IQRs and 10/11 positive deltas (one tie); record it as an adverse result despite its small absolute magnitude.
Connect was the first RPC in 100% of samples across both harnesses, both arms and controls. Each measured real reload issued one document navigation. Real settled mounted transcript rows remained one in both routes (the tall final virtualized row); native counts remained four chat / three dashboard. Real sidebar mounts fell 142→10; native 139→31. These are mounted DOM counts, not deletion of logical sessions. Native settled header sequences matched in every pair. The native harness does not expose owner hello-handled or final-row DOM completion in this configuration; its received-hello milestone must not be substituted for those missing metrics.
A/A controls
All paired deltas
Pair order is chronological within each route and harness. Units follow the tables above.
Real A/B
Real A/A
Native A/B
Native A/A
Attribution: three profiled warm loads per route
CPU profiles and Chrome traces were captured together for attribution only. Profiling inflated absolute times; none of these samples entered the unprofiled gate. Samples were sorted by cumulative timestamp before phase clipping to handle negative/out-of-order V8 sample deltas. Owner self time is exclusive; inclusive maxima overlap and must not be added. Source maps came from the matching baseline assets.
(program)selfThe unattributed
(program)bucket is not evidence of a half-second parse/GC pause. Correlating each native sample with its innermost covering main-thread trace event places 45.7–142.2 ms per sample inFunctionCall, another 11.7–12.5 ms inv8.callFunction, and smaller amounts in RunTask, paint, prepaint, layerization and optimization finalization. Minor GC across the whole gap is 7.0–23.2 ms; layout 12.5–38.7 ms; style 6.6–34.3 ms. These trace durations overlap other owners. Generic native callback work remains opaque to this JS profile: exact C++ ownership insideFunctionCallwas not resolved. No claim is made that every millisecond is assigned to a specific native function. The observed lever was fewer row subtrees, not relocating geometry reads or rewriting the bridge.Regression proof and code size
The new prepared-facts test fails on the old implementation: catalog element visits are
[100,101,2]instead of[1,1,1]across repeated/interleaved reads and replacement. The new browser regression fails on old code with 184 mounted rows versus a budget of 24 for 97 populated groups / 600 px viewport. It passes with the fix and checks header retention, scroll reachability, selected-row retention, collapsed content and invariant scroll height.Single-file local runner commands used
node scripts/run-vitest.mjs <file> --maxWorkers=1:ui/src/lib/gateway-methods.test.tsui/src/components/app-sidebar-session-visibility.browser.test.tsui/src/lib/session-method-access.test.tsThese are measured runner times, not fabricated timings for an unexecuted
pnpm testwrapper. Total: 42 tests passed. Changed-file formatting andgit diff --checkpassed. Detached local autoreview completed with no actionable P0–P2 findings; its reviewer did not execute the tests and lacked surrounding repository context, so source inspection and the actual tests provide that evidence.Runtime production delta is +13 LOC: sidebar window +3/−1 and method facts +12/−1. Growth retains the existing virtualizer and one weak catalog cache; no new render system was added. Existing regression files grow by exactly 80 net lines; the per-change test allocation is exactly 80 with its reason. Five tracked files: those two runtime modules, the two existing test files and
config/test-lines-allocations/sidebar-warm-boot-render-budget.txt.Required stat excluding
*.test.ts, test-support and docs: 3 files, 17 insertions, 2 deletions (includes the two-line test allocation; runtime alone is +13). No changelog edit; release-note context if revisited: avoid mounting offscreen grouped sidebar overscan and reuse prepared advertised-method membership on warm reload.Validation limits and setup recoveries
This failed experiment did not run check-changed, full typecheck, native UI e2e files or the full UI e2e suite. Those remain required before any future ready PR. Exact-head draft CI at closure has 10 successful, 87 skipped, five queued/in-progress and one cancelled
auto-responsejob, with no failed checks. Broad UI proof was skipped on the draft; this is not a claim of a green full validation run. The cancelled advisory automation is not a product-test failure; no rerun was requested.The first native invocation used a now-rejected mock port. It was corrected to supported HTTP/mock ports 49660/49661. Real isolated Gateways remained on 196xx loopback ports. An early combined real A/A run completed chat but failed dashboard peer preparation; it was excluded. Separate route runs completed after fixing diagnostic peer setup to await the real
sessions.viewers.setACK before pausing each viewer. All candidate warm samples retained three viewers. This was fixture-only synchronization outside the timed region, not a production change or a bypass of the viewer guard. The initial remote command therefore ended unsuccessfully; later complete comparisons used the same retained lease and exact pinned runtime. No retries were used to select favorable pairs.Settled synthetic screenshots
These full captures were inspected for private data and credentials. They contain only synthetic fixture data. They demonstrate settled visible layout, not first-frame completeness or timing gates. The screenshot pass was separate from all timed pairs.
Chat before:
Chat after:
Dashboard before:
Dashboard after:
Open questions for the lead
The render-window defect has deterministic red/green proof and broad LoAF gains, but accepting this candidate requires a different explicit gate or further work to meet the existing one. The tiny native dashboard CLS movement needs attribution before a future ready PR. Native owner hello-handled/final-row completion instrumentation and a complete cached first-frame audit remain gaps. No production geometry/bridge rewrite or sidebar product change is proposed from these results.