Repository navigation
fix(ui): composer jitters when a draft reaches its height cap in Safari - #186232
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 changesThis PR keeps composer text width stable when a draft reaches its height cap in WebKit and overlay-scrollbar browsers. Example: A multiline draft reaches the height cap in a 342px-wide composer.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a demonstrated composer regression still present on main, with a focused repair and no actionable correctness findings; CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared Control UI textarea owner receives input and resize events, measures overflow, and updates scrollbar, height, and fade presentation for Chat, New Session, and answer fields. flowchart TD
A[Draft input] --> B[Shared textarea owner]
C[Resize observer] --> B
B --> D[Overflow measurement]
D --> E[Scrollbar and padding selection]
E --> F[Stable composer layout]
Technical reviewBest possible solution: Keep the repair in the existing textarea owner, preserving equal text width across overflow transitions without restoring short-draft gutter overhead. Do we have a high-confidence way to reproduce the issue? Current-main overflow and padding logic establishes the feedback loop, and the supplied WebKit captures show it visibly; this read-only review ran no target code. Is this the best way to solve the issue? The patch repairs the width invariant at its existing owner, preserves native sizing and short-draft behavior, and adds focused coverage for the two scrollbar modes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 364c0d4ebcd4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +31, Tests +51. Total +82 across 3 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 27, 2026, 3:28 PM ET / 19:28 UTC. |
|
Merged via squash auto-merge.
|
…t e2e (#186409) ui/src/e2e/new-session-page.prompt-attachments.e2e.test.ts failed 10/10 on main: it expected the composer prompt overflow to be `auto`, but #186232 (ca9ee27, Safari jitter at the draft height cap) intentionally keeps classic scrollbars (`scroll`) to prevent height oscillation and updated its own tests, missing this one. The stale assertion now expects the intended `scroll`; the test's geometry and interaction assertions are unchanged. Native bisect identified ca9ee27 as the introducing commit. Production LOC 0, test-line delta 0. The file passes 11/11 locally and on AWS; exact-head CI green; full UI e2e failures reproduce on pinned main; autoreview clean through P2.
…ri (openclaw#186232) * fix(ui): stop composer jitter when drafts reach the height cap * test(ui): pin composer cap test to its unstable drafts
…t e2e (openclaw#186409) ui/src/e2e/new-session-page.prompt-attachments.e2e.test.ts failed 10/10 on main: it expected the composer prompt overflow to be `auto`, but openclaw#186232 (5372568, Safari jitter at the draft height cap) intentionally keeps classic scrollbars (`scroll`) to prevent height oscillation and updated its own tests, missing this one. The stale assertion now expects the intended `scroll`; the test's geometry and interaction assertions are unchanged. Native bisect identified 5372568 as the introducing commit. Production LOC 0, test-line delta 0. The file passes 11/11 locally and on AWS; exact-head CI green; full UI e2e failures reproduce on pinned main; autoreview clean through P2.
What Problem This Solves
Fixes: the chat composer jitters (text rewraps and the page bounces every frame) when a draft reaches the composer's maximum height in Safari, iOS, and other overlay-scrollbar browsers.
User Impact
User impact: typing or deleting across the composer's height cap is steady again on iOS and desktop Safari; the text width no longer changes when the draft starts scrolling.
Why This Change Was Made
#185199 swaps 8px of end padding for a
scrollbar-gutter: stablegutter once a draft overflows. Chromium reserves that gutter, but WebKit reserves it only while a scrollbar is actually shown, and overlay scrollbars (iOS, Android) reserve nothing. Near the cap the swap therefore widens the text by 8px, the draft fits again, the swap is undone, the text narrows, it overflows again, and the composer'sResizeObserverrepeats the cycle every frame.The composer now forces a real scrollbar (
overflow-y: scroll) while it reserves the gutter, measures the scrollbar width once per textarea, and keeps the plain padding (no swap) where that width is zero. Short drafts keep the #185199 fast path.Evidence
Six consecutive captures of the real composer in Playwright WebKit with a draft at the cap. Before: the last line alternates between two layouts. After: identical frames.
chat-composer-overflow.browser.test.tsxcase finds the drafts that overflow only until the 8px swap widens the text, asserts such drafts exist (so a font or layout change cannot make it pass vacuously), and types across them, assertingdata-composer-scrollablestops toggling. Overlay (zero-width) bars run in both engines; classic bars run in WebKit only, since Chromium reserves the stable gutter.chat-composer-overflowandchat-composer-mobilebrowser files pass in WebKit and Chromium;chat-composer-sizing,chat-mobile-scroll-fades,new-session/composerunit tests pass;composer-text-readability.e2epasses (its overflow assertion now acceptsscroll).pnpm tsgo:ui, oxlint on touched files,pnpm format:check,git diff --checkclean.