Repository navigation
perf(ui): avoid native scrollbar work for short chat drafts - #185199
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 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. |
|
Codex review: needs changes before merge. What this changesThis PR reserves the chat editor’s native scrollbar gutter only when its existing overflow owner detects scrolling. Example: Type “Synthetic typing 0123456789” into a short desktop chat draft.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this useful performance repair preserves the composer design, but its stronger CSS selector breaks the existing classic-scrollbar regression fixture. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherThe shared composer DOM owner measures textarea overflow and publishes presentation attributes; composer CSS translates those facts into padding, scrollbar gutters, and scroll fades. flowchart TD
A[Draft edits] --> B[Textarea overflow owner]
C[Resize and scroll events] --> B
B --> D[Scrollable attribute]
D --> E[Composer surface CSS]
E --> F[Padding or native gutter]
Technical reviewBest possible solution: Keep the owner-driven gutter exchange and strengthen the classic-scrollbar fixture’s explicit CSS override without weakening its shrink assertions. Do we have a high-confidence way to reproduce the issue? Current main unconditionally reserves the gutter, the supplied benchmark isolates its layout cost, and current-head CI independently demonstrates the fixture break; no local execution was performed. Is this the best way to solve the issue? Publishing the existing owner’s measured overflow state is a small complete repair that preserves geometry without adding measurement, scheduling, or reactive ownership. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 50b9e88fd3c3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +8, Tests +21, Other +2. Total +31 across 4 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 26, 2026, 8:08 PM ET / October 27, 2026, 00:08 UTC. |
|
HF-UI-SHARD3-HANG: the diagnostics repairs are on main in 8d50df8c269 and 183e4943702. The test step previously had no deadline below the job timeout, so cancellation prevented the failure upload. It now stops at 20 minutes inside the unchanged 25-minute job budget. The progress artifact records active fork-pool case IDs and source locations without test titles or values. Failure parsing also accepts Vitest's line/column suffixes, preserving exact test-name attribution. The hang did not reproduce: current-main shard 3/6 passed locally (133 files, 517 tests, 598 seconds), and a Linux replay of the stream PR's main parent Please merge current main before the next attempt. The original cancellation's cause remains unproven; these changes make another occurrence retain the file and case location instead of losing all timeout evidence. No assertions, test selection, or worker limits were weakened. |
|
Cross-check update: #185130 and #185199’s original timed-out shard inventories share 74 of 133 files, including Current #185130 head Other current failures are being attributed by exact test name against scheduled main or an actual merge-base replay; no shard-wide inherited claim. |
Keep the text inset constant with padding for short drafts and exchange it for the native gutter only when the existing overflow owner detects scrolling. This removes per-keystroke native layout overhead introduced by #184759 while preserving long-draft scrolling and shrink behavior. Advance the benchmark renderer before waiting for optional idle preloads so headless Chrome does not strand the callback.
29ddc47 to
b971041
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…#185199) * perf(ui): reserve composer scrollbar gutters only on overflow Keep the text inset constant with padding for short drafts and exchange it for the native gutter only when the existing overflow owner detects scrolling. This removes per-keystroke native layout overhead introduced by openclaw#184759 while preserving long-draft scrolling and shrink behavior. Advance the benchmark renderer before waiting for optional idle preloads so headless Chrome does not strand the callback. * fix(ui): retain composer gutter override specificity * test(ui): await the Home scroll target before settling * test(ui): observe each slash-menu keyboard selection * perf(ui): account for measured composer CSS cost * test(ui): await sidebar layout after metadata updates * test(ui): synchronize comment preview and identity setup
What Problem This Solves
Typing into a short chat draft paid for native scrollbar-gutter layout even when the draft could not scroll. The interaction census traced a repeatable layout regression to #184759.
User Impact
Short drafts avoid the unused native gutter. Text alignment, long-draft scrolling, shrinking, and the composer design stay unchanged.
Why This Change Was Made
The existing textarea overflow owner now publishes its measured scrolling state. CSS uses equal padding for a short draft and exchanges that padding for the real gutter only when scrolling is needed. No new timer, cache, layout read, or Solid effect is introduced.
The benchmark also advances two native frames before waiting for optional navigation preloads. A diagnostic captured a ready shell with an idle callback that never ran in headless Chromium; slower polling still timed out. The frame preparation passed 18/18 base/head/base supplemental cells without changing the original completion predicate.
Evidence
Each CPU cell below is 20 counterbalanced base/head/base triplets on the same Mac, with thread CPU counters and no profiler. Workload: the existing 27-character
chat-typingscenario, desktop and mobile, 1× and 4× CPU throttling. Values are median / p95 milliseconds. A/A retains the second unchanged base in every triplet.The earlier traced census found the same 33 layout events and per-key dirty-object shape in all roles. The extra cost was inside native text-input layout. A five-triplet equal-geometry CSS bisect removed it before this production implementation. At 4×, layout CPU median falls 29.84% desktop and 27.73% mobile, while total CPU falls 4.61% and 4.41%, with improved p95s. At 1×, layout falls 23.8–28.4%; total CPU stays within the A/A variation. Desktop 1× script median rises 6.47% against the first base (A/A rises 4.89%), so this is not a universal scripting improvement. The tables above retain scripting and total CPU movements; layout savings are not described as equivalent end-to-end latency savings.
Validation: the new short-draft gutter assertions failed on base at both viewport sizes; all 11 composer browser tests and 5 sizing tests pass with the fix. UI types, targeted lint, style lint, controller guards, production Knip, and independent review passed. Eight inspected synthetic screenshots and geometry assertions cover short, overflowing, and shrinking drafts at desktop/mobile sizes.
The script-lint wrapper first stalled on its own nested artifact lock. After its owned processes were stopped and the retained lock was recovered according to the owner instructions, the supported existing-artifact lint mode passed. No lint rules were disabled.
Startup: 269,908 → 270,444 B gzip (+536 B), with 5 JS requests and 1 CSS request unchanged. The strict base/head performance check has zero violations. Final build metadata and independent Git checks both verify committed clean head
29ddc47b8316e8f56192853833e2695a94d1f013. The earlier timing artifact remains pinned toa369d51; itsdirty:nullmetadata and independent clean-Git receipt are retained unchanged.CI correction: the initial full run exposed an attribute-selector specificity regression in
chat-composer-undo-redo. The baseline passed all nine tests across that file andwarm-history-subscription; the original candidate passed eight and reproduced the scrollbar-shrink failure. The final:where(...)selector preserves the original override specificity, and the final artifact passes all nine. Two warm-history setup failures in the initial CI run did not reproduce on baseline, original candidate, or final candidate; no persistence change or claim of fixing those failures is included.CI recovery and test repairs
This branch now incorporates main's shard diagnostics (
8d50df8c269,183e4943702). The original UI3 cancellation was rerun once with coordinator authorization: job121934221647 →121946502337 timed out at30:01 without a named case. It was not rerun again. Later diagnostic-base runs40435965201,40439033673,40441637082 and40443760537 all completed UI3 without a hang; it passed or reported the known rail assertions. No missing shard coverage is waived.The full runs also found intermittent test observations that did not reproduce on their exact CI bases; none is labeled inherited:
Last completed full run40443760537, head5574e62, had40success/24skipped and five assertion jobs plus the aggregate. Its actual checkoutf47305ae had parents45798e64 and5574e62 and reconstructed tree d889935e. Quota recovery and both rail assertions match exact names/signatures in scheduled main40439954043. Both Gateway100/140percent cases reproduce at the same connected-footer wait on exact base45798e64 (local10s, CI30s). The mobile profile:true and comment-draft cases passed both exact-base macOS and Linux replays, so they remain our unqualified failures until replacement CI proves the corrections. The Linux lease stopped and native cleanup reconciled.
The raw-CSS cap was explicitly raised from1597441 to the measured1597581 after a+156B cost for the measured composer win. Performance checker tests41/41 and independent review passed. No startup/gzip/request limit changed. Last completed performance job121990397132 measured startupJS270454→270532B gzip (+78B), startupCSS32180→32180B, totalCSS307666→307694B gzip (+28B), raw1597356→1597512B (+156B). Requests stayed5startupJS/1startupCSS. This small byte cost is accepted under the coordinator's measured-win rule, not called inherited or hidden as variance. Current exact-head job122001564477 passes the strict check: startupJS270522→270361B gzip (−161B), startupCSS32175→32175B, totalCSS307635→307665B gzip (+30B), rawCSS1596797→1596953B (+156B). Requests remain5startupJS/1startupCSS. Its checkout1969e331 has ordered parents7d87a633 andffcaaf43428; independently reconstructed treecda24f6804 matches. Original timing evidence keeps its revision identity.
Current replacement head:
ffcaaf43428a8c490b1415a5cbd81a5d0ae555d3, containing the clean main merge and final test corrections. Identity10/10, comment2/2, UI types and fresh independent P0–P2 review pass. Full CI40447155687 completed:44successful jobs,24skipped, one failed UI assertion job and the aggregate. Shard3 and both real-Gateway shards passed; all repaired cases passed.ci:fullwas enabled for that run. Its three remaining failures in UI2 job122001564883 match the latest completed scheduled main40445322734, job121995418869:The two tests and named rendering/style owner blobs are identical between actual CI base7d87a633 and tested merge1969e331. The native evidence accounts for every job and retains failed CI; no new failure is waived. The original auto request is confirmed-cancelled; landing uses native replacement recovery with that exact-head inherited evidence.
The complete final screen passed 312/312 cells with certified single-task CPU maxima, across all 26 scenarios, two viewports, 1×/4× and base/head/base. Those timings remain pinned to the pre-correction
a369d51artifact. The final selector changes no declarations or normal fixture matches; refreshed final-head geometry and all eight inspected captures preserve those states. No final-head timing re-labeling is claimed.Scope:9files,8523→8566lines (+43net; current candidate). UI production1978→1986 (+8). The imperative overflow owner and existing observer/listener lifetimes remain unchanged; no effect, subscription, owner API call or rendering controller was added.