Repository navigation
fix: keep chat reload geometry stable - #183072
Conversation
Reserve lazy widget height, preserve the visible transcript anchor as deferred overscan resumes, and keep reactions in existing footer space. Append late desktop Automations below retained sections. Extend reload evidence to cover routes, themes, viewports, and cache states.
Keep the translated virtual row window out of intrinsic size accounting and finish deferred overscan measurements through the existing initial-layout owner. Preserve end-follow without adding a retained row outside the normal window.
|
🦞👀 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 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db6a7c21f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89734d42b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs maintainer review before merge. What this changesThis PR reserves space for delayed Chat content and measures transcript rows before displaying geometry changes. Example: Reload Sessions on a 390×844 mobile viewport while the agent chooser loads.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses visible reload movement, and all four earlier findings are resolved with no new actionable code defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI projects saved and live session data into message components, then uses the existing transcript virtualizer and layout owner to place measurable rows in the browser. flowchart TD
A[Saved and live session data] --> B[Transcript projection]
B --> C[Messages and deferred widgets]
B --> D[Session virtualizer]
C --> E[Measured layout]
D --> E
E --> F[Browser transcript]
Technical reviewBest possible solution: Retain the focused geometry repairs and existing owners, then land after the exact-head checks are satisfied. Do we have a high-confidence way to reproduce the issue? The base rendering paths and inspected paired browser captures establish reload movement; this read-only review did not run target code. Is this the best way to solve the issue? The change repairs reservation, projection identity, and scroll-compensation ordering at their existing owners, with a shared geometry helper preserving the lazy widget boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6f3ac84c9a60. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +203, Tests +555, Docs +2, Other +187. Total +947 across 40 files. Added test files: 1. View PR surface stats
Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed October 25, 2026, 1:25 PM ET / 17:25 UTC (Revision 2). |
Keep mounted row refs authoritative across detached ResizeObserver receipts and register them again on commit. Reserve the inner sidebar resize target so content controls stay clickable, and navigate virtualized fixtures before checking offscreen rows. Retain strict layout admission and ratchet startup to the measured full-plugin build. Independent review: no actionable P0-P2 findings.
Record the final full-inventory build at 271110 B gzip, compared with 271146 B on the matching base and identical raw startup bytes. This is the measured-value correction to the baseline update covered by the final independent repair review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c47fc1d770
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await page.setViewportSize( | ||
| layoutCell.viewport === "mobile" | ||
| ? { width: 390, height: 844 } | ||
| : { width: 1719, height: 1179 }, | ||
| ); |
There was a problem hiding this comment.
Match device emulation to each layout matrix cell
When --layout-matrix runs with the default desktop viewport, its mobile cells only resize the page; isMobile and hasTouch remain false because they are set once when the browser context is created. Consequently, these cells do not exercise the same layout as --viewport mobile: for example, the (pointer: coarse) composer font sizing in ui/src/styles/chat/composer-surface.css and touch input floor in ui/src/styles/base.css remain inactive. Conversely, starting with --viewport mobile leaves desktop cells touch-emulated. Use a context configured for each cell's device mode so the reported mobile/desktop geometry and layout-shift results represent the intended environments.
Useful? React with 👍 / 👎.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix(ui): keep chat reload geometry stable Reserve lazy widget height, preserve the visible transcript anchor as deferred overscan resumes, and keep reactions in existing footer space. Append late desktop Automations below retained sections. Extend reload evidence to cover routes, themes, viewports, and cache states. * fix(ui): measure resumed transcript rows before paint Keep the translated virtual row window out of intrinsic size accounting and finish deferred overscan measurements through the existing initial-layout owner. Preserve end-follow without adding a retained row outside the normal window. * refactor(ui): keep transcript measurement guard compact * fix(ui): reserve the mobile Sessions agent chooser slot * test(ui): stabilize reload proof and asynchronous fixtures * fix(ui): reserve desktop header space during reload * fix(ui): preserve reactions during assistant continuation * style(ui): format continuation reaction footer * fix(ui): reserve inner header and transcript row geometry * fix(ui): preserve inset contracts and settle layout assertions * test(ui): park pointer outside rail menus before Escape * test(ui): record reaction visibility and motion reversals Keep the mobile motion assertion intact and retain frame geometry when it fails. Count mounted visible reaction rows after CPU collection to expose content differences in reload measurements. * fix(ui): reserve mobile activity clearance during reload Keep the measured 44px activity strip footprint before its metadata arrives. This prevents the late 48px transcript correction at the cached-to-live handoff. The new geometry regression fails before the CSS fix and passes after it. * test(ui): navigate to virtual history before identity checks * test(ui): prepare lazy typing renderer before presentation checks * fix(ui): keep transcript dependencies with their projection Capture each projection dependency vector with the native content it describes so a queued geometry replay cannot suppress late reactions. Cover old-to-new replay and retained bubble identity at the renderer boundary. * fix(ui): retain question generation with transcript projections Keep the presentation dependency paired with its fenced Answer callback when virtual geometry replays an older durable-question projection. * test(ui): stabilize reload validation checks Reserve 64 bytes above the measured CI raw CSS total. Pin the date in annotation geometry scenarios so independent relative-label minute refreshes do not replace the focused quote during the assertion. * test(ui): target reload matrix cells for timing attribution * chore(ui): retain measured CSS build variance * fix(perf): avoid shadowed layout filter bindings * test(perf): retain native reload CPU phase counters * fix(ui): retire benchmark pages before swapping bundles * perf(ui): defer initial transcript overscan until navigation * fix(ui): measure transcript overscan before first navigation paint * test(ui): catch first-wheel transcript layout shifts * fix(ui): preserve navigation during transcript measurement * test(ui): navigate before inspecting virtualized history * fix(ui): keep overscan from restarting end-follow Only initial placement or an existing end command may request end-follow while measuring rows. Preserve explicit restoration and widget scrolling when admitting overscan. Keep retirement fixtures at consistent row sizes and settle empty-history scroll before keyboard focus assertions. * fix(ui): admit transcript overscan on reader movement Only actual nonprogrammatic offset changes admit offscreen measurement. Preserve nested and canceled wheel behavior, progress gestures, and history navigation. Navigate virtualized content explicitly in copy, oversized history, and catalog fixtures without weakening assertions. * fix(ui): restore retained transcript observers after rewind Keep mounted row refs authoritative across detached ResizeObserver receipts and register them again on commit. Reserve the inner sidebar resize target so content controls stay clickable, and navigate virtualized fixtures before checking offscreen rows. Retain strict layout admission and ratchet startup to the measured full-plugin build. Independent review: no actionable P0-P2 findings. * perf(ui): record final measured CLS startup baseline Record the final full-inventory build at 271110 B gzip, compared with 271146 B on the matching base and identical raw startup bytes. This is the measured-value correction to the baseline update covered by the final independent repair review. * fix(ui): reserve lazy mobile panel chrome on reload * test(ui): measure reload layout through Gateway HTTP * test(ui): match CSS cap to measured CI bundle * test(ui): wait for question footer dismissal geometry
What Problem This Solves
Chat reloads move painted content as widget dimensions, reactions, identity, mobile chrome and transcript measurements arrive. Mobile Sessions also inserts controls after its initial frame. This change reserves their space at the existing rendering owners and keeps measured transcript rows stable through the saved/live handoff.
User Impact
Every cell in the final production-HTTP reload matrix is below 0.02 CLS. Existing routes, host tags, selectors, keyboard controls, reader restoration and lazy boundaries remain. Mobile installations without activities retain 44 px of reserved clearance. The remaining mobile Settings description shift is 18 px / 0.0129791 CLS, accepted within the stated target.
Implementation
Widget loading fallbacks use the final preview dimensions. Reactions share the reserved message footer; identity gutters, desktop header actions, mobile activity and lazy panel chrome retain their eventual dimensions. The transcript measures its visible tail before revealing it and admits offscreen overscan after reader navigation; existing restoration and scroll-compensation owners retain authority. Retained Solid refs survive temporary virtualizer detachment and reconnect to observation. No dependency was added.
The benchmark now permits its existing isolated Gateway HTTP server in the layout matrix. Production rewrites relative asset URLs before serving deep links; preview only remapped incoming requests, causing the same 12 JS and 3 CSS assets to load again under another URL during idle prefetch. The failed preview timing study remains recorded; it is not relabeled as passing. No production navigation-prefetch policy changed. Text-node layout-shift entries now name their parent element.
Evidence
Baseline: raw main
77a7ce297e981298390150cdb6c57988bf769925. Rendered candidate:f5af7293f7cb6c0d584ba28399ff41588022367c; subsequent changes affect only benchmark attribution, measured budget records and test synchronization. Both complete bundles were built on the same machine; base and A/A copies are byte-identical. The benchmark uses the production Gateway HTTP handler with synthetic bootstrap, WebSocket RPC and media, 240 messages, 12 widgets, 35 ms RPC latency, 4 ms frame gap and fixed fixture time. It does not measure a live provider.All 32 route/theme/viewport/cold-or-warm cells reached readiness, with pending and queued work at zero. All screenshots were inspected and contain only synthetic data. Every Chat endpoint retained its final reaction and ready inline/dashboard widgets. There were no duplicate JS/CSS asset URLs or deep-path asset aliases. Initial Settings Appearance is the tested Settings viewport.
Timing acceptance
Prespecified before collection: 20 serial interleaved base/A-A/head triplets per mobile light/dark cold Chat cell (120 observations); CLS ≤0.02, script/task CPU median regression ≤5%, p95 no worse beyond the 1% reporting floor. The prespecified cell-wide noisy-A/A rule uses native thread CPU and structural counts when readiness controls fall outside the band. All 40 candidate reloads have CLS ≤0.00817387. No samples were filtered and no control values subtracted.
Raw readiness non-regression is unproven. Light composer median/p95 is 215.75/313.30→231.75/370.50 ms (+7.42%/+18.26%); light transcript is 433.30/485.60→424.30/532.00 ms (−2.08%/+9.56%). Dark composer is −6.19%/−0.18%, transcript −1.56%/−5.36%. A/A light transcript p95 is +1.96%; dark composer/transcript p95 are +13.26%/+2.28%, so the predeclared cell-wide CPU fallback applies. The light composer’s own A/A result does not prove its delay is noise. Host load was recorded; acceptance is the CPU/structural result above, not a raw wall-time claim.
The superseded 120-observation preview study failed its CPU rule (light script p95 +1.81%, dark task p95 +26.16%). Its duplicated asset graph and long widget waits are retained as diagnostic evidence, distinct from the corrected Gateway study. Earlier preview filmstrips remain visual evidence of the layout changes, not final timing proof.
Same-machine assets
Startup raw JS is unchanged at 841,032 B. The +118 B startup JS and +266 B CSS gzip cost is explicitly accepted for the measured CLS improvement. The initial updater recorded the measured startup value of 271,987 B. Resolving the later main merge retains main’s newer measured 271,935 B baseline; the new CI run compares the integrated head and its current base. The local measured CSS head was 307,601 B gzip / 1,596,849 B raw. CI run 40236522513 then built merge
caafdfb8over main42f3593a: CSS was 307,441→307,705 B gzip and 1,595,410→1,597,377 B raw. Its 264 B gzip / 1,967 B raw increase matches the local reservation cost, but exceeded the local cap. Final CSS caps use that CI-measured head plus 64 B: 307,769 B gzip and 1,597,441 B raw. CI startup was 271,422→271,415 B gzip, with the same five JS and one CSS requests. The final-head performance job in run 40238117369 passes with those same measured values and caps (tested merge21af2b7f, head3b52b46). Strict base/head comparison has zero violations. This is explicit growth acceptance, not inherited growth.Correctness and review
UI typecheck on the integrated rendering head and final script typecheck pass. The focused performance-budget test passes 41/41, including the CI-measured cap correction; scoped lint, formatting, strict base/head assets and final production Knip pass. The final independent P0–P2 review reports no actionable findings.
Earlier full CI runs 40220440820 and 40224818575 exposed 17 and six E2E failures; none was classified inherited. The fixes retain assertions while navigating virtualized rows through native input. Focused rewind-completed, disclosure and catalog proof passes. Two rewind variants hit Chromium newContext/SIGSEGV locally. A real-Gateway folding attempt failed during setup after a concurrent build-identity change; that is not a folding pass. Full run 40236522513 finished with 55 successful jobs; all seven Control UI E2E shards and all UI unit shards passed. Its CSS cap failure is repaired in the next head against the measured bundle. The two remaining real-Gateway failures—“discovers Platform programs in the UI without submitting an inference request” and “persists visible selections and refreshes queued requests on desktop and mobile”—also fail with the identical assertions in the latest completed scheduled main run 40235797323 at
8937cb4(undefined versus empty array; zero versus one selector). These exact failures are inherited; no other failure is waived. The budget-only successor run 40238117369 passed performance and 55 jobs but exposed one additional landscape question test failure: the native tap left the question collapsed. An isolated replay and a diagnostic replay of all 16 question-flow tests passed. The trace shows the collapsed button moves 120 px while Details dismisses; the test now waits for its geometry to settle before the same native tap. This is a test synchronization repair, not proof of the precise missed event in the failed CI attempt or of tapping during animation. All existing layout, draft, expansion and Gateway assertions remain. The synchronized portrait/landscape cases pass (2/2,54.90 s including the isolated production bundle), UI types and scoped lint pass in the proof checkout, and independent P0–P2 review found no actionable finding. The full diagnostic replay passed16/16 in71.07s; these existing E2E cases protect native input and Gateway contracts that an isolated unit cannot. Mergecebc60c5incorporates main4fa442e3to resolve the budget-record conflict, retaining main’s measurement. The final replacement receives fresh exact-headci:fullbefore native recovery; no additional failure is classified inherited.The retained-ref regression is red before its repair and 7/7 green after it. The held-real-import mobile chrome regression is red before its reservation and green after, including optional grabbers. LTR/RTL sidebar target, native scrollbar and drag cases pass. An existing above-viewport growth/shrink diagnostic fails on both historical base and head; this reload change does not claim to fix dynamic-height growth.
Inspected synthetic before/after media
Media timestamps are individual capture phases, not a paired readiness comparison. The final Gateway matrix and Settings filmstrips were also inspected.
Size and ownership
58 changed files against current main: 36,887→38,061 lines (+1,174). UI production remains 13,566→13,800 (+234); the remaining growth is coupled regression coverage, benchmark source/attribution and evidence policy. Twelve lazy boundaries are retained. The Solid census is signals 4→5, memos 22→23, lifecycle settlements 3→3 and listener sites 10→10; no effect, direct DOM listener/query, manual cleanup, flush or owner-capture call was added. Domain and geometry owners retain authority.
No active Testbox/Crabbox lease. The queued Testbox was stopped without running tests and is confirmed completed (
tbx_01m5t5sbnn7mqz6nfyb3ph05yc, run 40222315334).Final integrated CI and native recovery
Run 40240782160, attempt 1, tests exact head
cebc60c5through merge9fda35b2over main4fa442e3: 56 jobs pass, including all seven Control UI E2E shards, UI units, performance, types, lint and security. Only real-Gateway 1/2 and its aggregate fail. Its two failing Platform-program tests match the exact names and assertions in latest completed scheduled main 40235797323: discovery returns undefined versus an empty array; persisted selections find zero versus one selector. Their test and four relevant inputs are byte-identical in scheduled main, the CI baseline and tested PR merge. Native inherited-failure recovery waives only these two tests. The landscape question case now passes in full CI.The integrated strict performance job passes: startup 271,207 → 271,508 B gzip (+301 B), five JS and one CSS requests unchanged; startup CSS 31,922 B unchanged. All CSS is 307,482 → 307,756 B gzip (+274 B) and 1,595,208 → 1,597,175 B raw (+1,967 B). This small byte cost is explicitly accepted for the measured CLS improvement under the campaign allowance; all current caps pass. Earlier same-machine study numbers above retain their original revision labels. Native recovery retains current failed-attempt evidence and does not claim all CI is green.