Repository navigation
fix(ui): standardize scrollbar styling across the Control UI - #124285
Conversation
Give the Control UI one canonical scrollbar definition (a 12px hit target with a thin, muted-at-rest, 6px painted thumb, derived from --muted so every theme family and both modes follow with no override) and delete the sixteen scattered per-surface overrides that used to make every scroll container look different. Shadow-DOM parity ships in the same change: a grouped ::part() rule covers Web Awesome menus/listboxes, and a shared Lit fragment covers the terminal/browser/desktop panels' own shadow roots, since neither ::-webkit-scrollbar* rules nor scrollbar-width cross a shadow boundary on their own. Fixes #124272
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 5:38 PM ET / 21:38 UTC. ClawSweeper reviewWhat this changesThe PR replaces per-surface Control UI scrollbar rules with shared theme tokens and a consistent thin-painted, full-hit-target profile across document, Web Awesome, and Lit shadow-root surfaces. Merge readinessKeep this member-authored, maintainer-labeled PR open. The prior Web Awesome coverage finding was addressed, but the intentionally changed scrollbar default still needs maintainer product acceptance and exact-head validation. Priority: P3 Review scores
Verification
How this fits togetherControl UI combines shared document CSS with Web Awesome menu parts and Lit shadow-root panels. Theme tokens flow into those surfaces to determine scrollbar dimensions and colors before the browser renders each scroll container. flowchart LR
A[Theme tokens] --> B[Shared document CSS]
A --> C[Web Awesome menu parts]
A --> D[Lit shadow-root panels]
B --> E[Chat and settings scrollers]
C --> F[Dropdowns and listboxes]
D --> G[Terminal browser and desktop panels]
E --> H[Rendered scrollbar profile]
F --> H
G --> H
Decision needed
Why: Current main intentionally distinguishes compact sidebars from document content, so source evidence cannot decide whether the broader default is the desired interaction design. Before merge
Agent review detailsSecurityNone. PR surfaceSource +30, Tests +141. Total +171 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Confirm one canonical 12px hit target with a 6px painted thumb as the Control UI default, then land only after exact-head UI validation confirms the generic Web Awesome and Lit shadow-root coverage. Do we have a high-confidence way to reproduce the issue? No high-confidence live current-main run was established; current CSS and tests source-prove the divergent scrollbar profiles, but the reviewer could not execute the UI harness. Is this the best way to solve the issue? Unclear; the consolidation and generic part selectors are coherent, but replacing the prior contextual sizing is a product decision rather than a purely mechanical repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 50df307fab6d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
The canonical scrollbar group enumerated six menu hosts plus the settings select, so every unlisted Web Awesome surface kept the raw platform scrollbar: a Chromium probe against the previous stylesheet reports width:auto and a fully transparent thumb for wa-dropdown::part(menu), wa-select::part(listbox), and wa-popover::part(body). Style the three generic part families instead -- the same host group the shared corner treatment already uses at base.css:435 -- which covers every dropdown, listbox, and popover in the UI and removes 23 production lines. The new-session composer's ten-line cap test asserted thinness as a <=6px hit target, which was the old shrink-the-target recipe the canonical profile replaces. It now asserts the real contract: a 12px hit target painting a 6px thumb through the transparent border. The chat-page e2e gains a genericity guard that walks every wa-dropdown/wa-select/wa-popover on the page and requires each scroll part to report the canonical width, so an unlisted component cannot silently regress.
|
Addressed the review finding and a sibling regression CI caught, in [P2] Cover all Web Awesome scroll parts — confirmed real, now fixed. The group enumerated six menu hosts plus Before/after probe in real Chromium, loading each stylesheet revision and reading computed styles off the shadow parts:
The repair also shrinks the change: production delta drops from +53 to +30 (+97/-67), because three generic selectors replace four repetitions of a seven-host group. Tests are +141. Sibling regression that CI caught. Rank-up moves. Both applied. The named allowlist is gone, and the chat-page e2e now walks every On the merge-risk question: the unified profile is the intended direction, and #124272 states it explicitly — one profile that keeps a full-size hit target while painting a thin thumb, rather than walking back the #107313 hit-target decision. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Re-review is clean on the code — no actionable findings at Uniform 12px hit target (P1, and the P2 "choose the new global default"). Accepted, and it is the direction #124272 asked for rather than a new choice made in this PR: "the 12px main / 6px sidebar split was a deliberate decision from #107313 ... This request does not walk that back. It asks for one profile that keeps a full-size hit target while painting a thin thumb." That is exactly what ships here — every surface keeps a 12px grab area and paints a 6px thumb through a transparent border, so the 6px surfaces (session sidebar, settings sidebar, new-session composer, capability menu) look the same as before and become easier to grab, while the heavy 12px document thumb gets quieter. Nothing regresses to a wider visible bar. Exact-head source and media could not be fetched (P1). That is an environment limitation on the review side, not a gap in the change. The head is Rank-up move — re-upload screenshots from the current head. Skipping, and noting why: the follow-up commit changed only which surfaces the rule reaches (unlisted Web Awesome dropdowns, listboxes, and popovers, which previously rendered the platform scrollbar), not the profile itself. The linked before/after captures of the model picker and the transcript/sidebar still show the exact visual result those surfaces have at this head. The newly covered surfaces are proven by computed-style assertions instead, which is the stronger check for "did this part get styled at all" — a screenshot of a menu whose fixture list does not overflow would show nothing either way. |
|
Merged via squash.
|
…w#124285) * fix(ui): standardize scrollbar styling across the Control UI Give the Control UI one canonical scrollbar definition (a 12px hit target with a thin, muted-at-rest, 6px painted thumb, derived from --muted so every theme family and both modes follow with no override) and delete the sixteen scattered per-surface overrides that used to make every scroll container look different. Shadow-DOM parity ships in the same change: a grouped ::part() rule covers Web Awesome menus/listboxes, and a shared Lit fragment covers the terminal/browser/desktop panels' own shadow roots, since neither ::-webkit-scrollbar* rules nor scrollbar-width cross a shadow boundary on their own. Fixes openclaw#124272 * fix(ui): reach every Web Awesome scroll part through generic selectors The canonical scrollbar group enumerated six menu hosts plus the settings select, so every unlisted Web Awesome surface kept the raw platform scrollbar: a Chromium probe against the previous stylesheet reports width:auto and a fully transparent thumb for wa-dropdown::part(menu), wa-select::part(listbox), and wa-popover::part(body). Style the three generic part families instead -- the same host group the shared corner treatment already uses at base.css:435 -- which covers every dropdown, listbox, and popover in the UI and removes 23 production lines. The new-session composer's ten-line cap test asserted thinness as a <=6px hit target, which was the old shrink-the-target recipe the canonical profile replaces. It now asserts the real contract: a 12px hit target painting a 6px thumb through the transparent border. The chat-page e2e gains a genericity guard that walks every wa-dropdown/wa-select/wa-popover on the page and requires each scroll part to report the canonical width, so an unlisted component cannot silently regress.
What Problem This Solves
The Control UI has no canonical scrollbar. Each scroll surface currently picks its own width and thumb color through one of three separate mechanisms (document
::-webkit-scrollbarrules, per-componentscrollbar-width/scrollbar-color, and shadow-DOM surfaces that no document rule reaches at all), producing at least five visually distinct scrollbars in a single window. The loudest sits on a popover: opening the chat model picker paints a wide, high-contrast thumb directly over the menu.The structural root cause:
base.cssreadvar(--scrollbar-size, 12px), but--scrollbar-sizewas never defined in the token layer — it existed only as three ad-hoc local overrides (layout.css,new-session.css). Everything downstream compensated with its own recipe: four different thumb colors and three different widths acrossbase.css,layout.css,chat/layout.css,chat/split-view.css, andnew-session.css.A third, invisible variant sat underneath all of that: document-level
::-webkit-scrollbarrules do not cross a shadow boundary, so Web Awesome menus and listboxes (the settings model picker, the model-setup provider dropdown, the composer capability menu, and others) rendered the raw platform scrollbar no matter whatbase.csssaid.Why This Change Was Made
One canonical definition, expressed through the existing theme tokens:
--scrollbar-size(12px),--scrollbar-thumb-inset(3px),--scrollbar-thumb, and--scrollbar-thumb-hoverare added to the main:roottoken block, derived from--mutedwithcolor-mix()— the same idiom already used for--link/--link-hoverand--focus-ring. Because every theme family already redefines--muted, this one definition covers all six themes in both light and dark with no hand-written color pair.background-clip: content-box, while the hit target stays a full 12px. This refines rather than reverses the earlier decision behind [Bug]: Make Control UI scrollbars contextual and app chrome non-selectable #107313 (a usable drag target on main content): one profile now delivers a full-size hit target with a thin, quiet thumb instead of the previous 12px-main/6px-sidebar split with a solid, heavy fill. The same applies to the other surfaces that bought thinness by shrinking their hit target — the settings sidebar, the session sidebar, the new-session composer, and the composer capability menu all keep a 6px-wide painted thumb while their grab area grows to the canonical 12px.::-webkit-scrollbar-track/-cornerand Firefox'sscrollbar-colortrack component. Nothing paints a visible track anywhere; only the thumb renders.scrollbar-width: thinand inheritedscrollbar-color, but no hover step — Firefox has no thumb-level hover hook, and a container-hover rule would repaint every nested scroller on the page becausescrollbar-colorinherits. This is a deliberate, accepted degradation: same tokens, one fewer state.base.css,layout.css,chat/layout.css,chat/split-view.css, andnew-session.cssare deleted in the same change. The two categories that intentionally remain — hidden horizontal rails (board-tabs__track, the dreams day-chips, the panel tab strip) andscrollbar-gutterlayout reservations — are untouched and covered by a regression test.base.cssreaches every Web Awesome scroll part through the genericwa-dropdown::part(menu),wa-select::part(listbox), andwa-popover::part(body)selectors — the same generic host group the shared corner treatment already uses, so a dropdown added tomorrow is covered without touching this rule — and a shared Litcssfragment (ui/src/lit/scrollbar-styles.ts) covers the terminal, browser, and desktop panels' own shadow roots, since neither::-webkit-scrollbar*rules norscrollbar-widthcross a shadow boundary on their own. Verified live: without the grouped rule, a shadow listbox's scrollbar thumb resolves to fully transparent and its width falls back to the platform default; with it, both resolve to the canonical token values.User Impact
Every Control UI surface with a scroll container — chat, settings, logs, activity, tables, dialogs, the command palette, native dropdowns, and the terminal/browser/desktop panels — now shares one thin, muted-at-rest, hover-emphasized scrollbar in both light and dark mode. The model picker, previously the most visible offender, now matches every other surface instead of standing out with a heavy, high-contrast bar.
Evidence
Before/after screenshots, dark and light, captured through the mocked Gateway dev harness:
The shadow-DOM lane (settings model picker, a
wa-selectlistbox) was verified live with agetComputedStyleprobe on the shadow part rather than a static screenshot, because the mock fixture's option list doesn't overflow that particular listbox: before the grouped::part()rule, its scrollbar-thumb resolved to fully transparent and its width fell back to the platform default; after, both resolve to the canonical token values (12px, the muted thumb color).Tests:
ui/src/e2e/app-chrome-interaction.e2e.test.ts— renamed and collapsed the old 12px/6px contract to one canonical width, added the model picker to the sampled surfaces, and added a dark/light pass that asserts the token-derived thumb color differs between modes and that a Web Awesome shadow-DOM menu's::part()scrollbar resolves to the canonical width and a real thumb color. A genericity guard walks everywa-dropdown/wa-select/wa-popoverrendered on the chat page and asserts each one's scroll part reports the canonical width, so an unlisted component cannot silently fall back to the platform scrollbar.ui/src/e2e/new-session-page.prompt-attachments.e2e.test.ts— the composer's ten-line cap test asserted thinness as::-webkit-scrollbarwidth<= 6px, which was the old shrink-the-hit-target recipe. It now asserts the canonical contract directly: a 12px hit target painting a 6px thumb through the transparent border.ui/src/components/form-controls.browser.test.ts— collapsed the same 12px/6px contract and added a check that the intentionally hidden.board-tabs__trackrail still reportsscrollbar-width: noneagainst the new blanket* { scrollbar-width: thin }rule.Production line delta is +30 (
git diff --numstaton the non-test files: +97/-67); tests are +141 (+150/-9). Deleting the scattered overrides removes 45 lines acrosslayout.css,chat/layout.css,chat/split-view.css, andnew-session.css; the canonical token/rule block inbase.cssnets +30 (it now also covers the shadow-DOM::part()group, including a full hover pass that the deleted rules never had); and the new Lit fragment plus its three-panel wiring for the terminal/browser/desktop shadow roots adds +45. The shadow-DOM lane — previously zero scrollbar styling on those surfaces — accounts for essentially all of the net addition; it is new coverage, not a rewritten existing rule. Reaching the Web Awesome parts through generic selectors rather than a per-component class list is what keeps that block small: it removed 23 production lines while widening coverage from seven named hosts to every dropdown, listbox, and popover in the UI.Fixes #124272