Repository navigation
improve(control-ui): continuous corner curvature with a radius scale - #124129
Conversation
Route every step of the Control UI radius scale through one knob and, on engines that can draw a superellipse, widen it by 1.25 while switching the app's surface families to continuous corner curvature. A corner that keeps curving into the edge reads as a shorter arc than a circular corner of the same radius, so the scale gives that visual weight back. The whole refinement sits behind @supports (corner-shape: superellipse(1.5)), so engines without it keep today's radii and today's arcs unchanged. The shape is opt-in per surface: a superellipse flattens the ends of anything fully rounded, and pills, circles, avatars and status dots are a third of this app's corners. Menu item radius is now derived from the menu panel radius minus its padding, which is the optical relation its comment already documented and which now holds at any corner scale.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 8:50 AM ET / 12:50 UTC. ClawSweeper reviewWhat this changesThe PR adds a browser-gated superellipse corner treatment and scaled radii to selected Control UI surfaces, with Chromium tests for enhanced and fallback rendering. Merge readinessThe prior corner-shape findings are addressed on the current PR head, and the browser-gated fallback is covered. This remains a maintainer-owned visual-product decision rather than a bug fix; it should proceed only after the intended supported-browser visual split is accepted and exact-head CI is green. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI’s shared stylesheet supplies corner styling to dialogs, menus, chat, cards, and form controls. Page-specific styles and components consume its radius tokens, while browser tests inspect computed styles in Chromium. flowchart LR
A[Browser support] --> B[Shared Control UI stylesheet]
B --> C[Superellipse corner rules]
B --> D[Circular fallback rules]
C --> E[Dialogs menus cards and chat]
D --> E
E --> F[Browser style tests]
Decision needed
Why: The implementation preserves fallback behavior and has direct browser-style proof, but the desirability of a cross-browser visual split is a maintainer product judgment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +159, Tests +373. Total +532 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Accept or decline the supported-browser visual language as a UI product choice, then merge only with green exact-head checks if it is accepted. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this PR proposes a visual enhancement. Its supplied Chromium screenshots and computed-style output, backed by the added browser test, directly exercise the intended enhanced and fallback states. Is this the best way to solve the issue? Unclear pending maintainer direction: the direct selector rules avoid inherited-token leakage and the fallback remains intact, but only UI product owners can decide whether the browser-specific visual language is desirable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c98ae0f99cb2. LabelsLabel 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 (4 earlier review cycles)
|
The @supports block scaled --openclaw-corner-radius-scale at :root, so every --radius-* consumer inherited the 1.25 multiplier — including surfaces that never opted into corner-shape (e.g. .run-inspector__panel, which stayed `round` but drew an inflated 12.5px radius) and the radius tokens mcp-app-theme.ts exports to embedded MCP apps. The canonical --radius-sm/md/lg/xl/--radius tokens at :root are back to their pre-refinement literal values. The scaled radii now live only on the selector list that also receives corner-shape, redeclaring the tokens locally so the widened radius stays contained to opted-in surfaces and their descendants. Menu panels needed their derived --menu-radius/--menu-item-radius redeclared too (a custom property's nested var() resolves relative to where it's declared, not where it's read, so redeclaring only --radius-md wouldn't reach them), and wa-dropdown/wa-popover/wa-select scale on the host rather than the ::part() panel since slotted menu items inherit from the light-DOM host, not from the shadow part they render inside. Adds regression coverage for the excluded consumer and the exported MCP theme tokens to corner-shape.browser.test.ts.
…to nested descendants Round 1 fixed the :root-level leak by redeclaring --radius-* as an inheritable custom property on each opted-in container instead. That still leaks: any non-opted descendant nested inside an opted surface inherits the container's redeclared token too. Proof: .settings-segmented nested inside .settings-group rendered 12.5px round instead of its canonical 10px, and .agent-chat__search-bar's own --radius-lg-derived corners doubled up incorrectly depending on ancestor nesting. Every opted selector now sets border-radius as a direct property computed from the scale, not an inheritable token — border-radius does not inherit, so nested non-opted descendants keep reading the untouched canonical --radius-* from :root. Each selector is specificity-doubled (`.card.card`) rather than !important, so it reliably outranks its own bare-class declaration in a later-loaded file without silently clobbering a genuinely more specific existing override elsewhere in the app (e.g. `.chat:has(> .agent-chat__search-bar)`, `.chat-task-detail__transcript > .chat-thread`) — both surfaced as regressions during this fix and are preserved by design now. The one exception is the generic wa-dropdown/wa-popover/wa-select ::part() panel selector, which by design must outrank dozens of concrete per-feature panel classes app-wide; a bare type selector can never out-specificity a class selector, so that rule keeps !important. --menu-item-radius at :root also serializes back to the byte-identical `var(--radius-sm)` from base f21d34d in the unscaled fallback path; the derived panel-minus-padding formula now lives only in the scaled wa-dropdown/wa-popover/wa-select host redeclaration where it's needed. Adds a nested-inheritance regression case to corner-shape.browser.test.ts (.settings-segmented inside .settings-group) and a .settings-group entry to prove the container itself still scales.
ClawSweeper caught two more instances of scale and shape traveling apart: 1. .option-card__choice wasn't in the corner-curvature list at all, despite being a real nested member of the .option-card family (a button inside .option-card__choices inside .option-card, drawn with the same 14px --radius-lg step as .card/.settings-group). It kept its canonical 14px round corner even under the scale. 2. .slash-menu-item / .chat-reply-context-menu button / .chat-selection-popup button picked up the scaled radius from round 2 but never got corner-shape, so their corners grew without curving into a squircle — scale without shape, the same incoherence class as (1) in reverse. Decision on (2): items get corner-shape added (not scale removed). The panel they sit in is already squircle; an item whose radius grows but stays circular reads as an unrelated circle poking out of the panel's superellipse, not a coherent nested row. A final invariant pass over the full @supports block (every selector that sets a live border-radius must also set corner-shape, and vice versa) found one more forgotten member beyond the two reported: .agent-chat__search-bar scaled its own (bottom-only) radius but never carried corner-shape, same gap as the menu items. Fixed alongside the reported two. Every remaining selector in the block already pairs the two; the wa-dropdown/wa-popover/ wa-select host rule is the one correct exception, since it only carries custom properties for descendants and draws no border of its own. Test coverage now exercises each surface's real nested DOM instead of a synthetic flat selector: option-card.ts's actual button-inside-choices- inside-card structure, chat-composer-slash-menu.ts's item three levels below the panel, and chat-thread-interactions.ts's plain <button> item matched via descendant tag selector. Added a corner field to CornerCase so the harness can probe the correct physical corner (search-bar's bottom-left is its only non-zero corner) instead of universally reading top-left. All four new/changed cases are proven to fail on pre-fix base.css with the exact "radius scaled, shape stuck at round" (or, for option-card__choice, "not opted in at all") signature before the corresponding fix.
|
Merged via squash.
|
…penclaw#124129) * improve(control-ui): continuous corner curvature with a radius scale Route every step of the Control UI radius scale through one knob and, on engines that can draw a superellipse, widen it by 1.25 while switching the app's surface families to continuous corner curvature. A corner that keeps curving into the edge reads as a shorter arc than a circular corner of the same radius, so the scale gives that visual weight back. The whole refinement sits behind @supports (corner-shape: superellipse(1.5)), so engines without it keep today's radii and today's arcs unchanged. The shape is opt-in per surface: a superellipse flattens the ends of anything fully rounded, and pills, circles, avatars and status dots are a third of this app's corners. Menu item radius is now derived from the menu panel radius minus its padding, which is the optical relation its comment already documented and which now holds at any corner scale. * test(control-ui): assert chat radii against the live corner scale * fix(ui): scope the corner-curvature radius scale to opted-in surfaces The @supports block scaled --openclaw-corner-radius-scale at :root, so every --radius-* consumer inherited the 1.25 multiplier — including surfaces that never opted into corner-shape (e.g. .run-inspector__panel, which stayed `round` but drew an inflated 12.5px radius) and the radius tokens mcp-app-theme.ts exports to embedded MCP apps. The canonical --radius-sm/md/lg/xl/--radius tokens at :root are back to their pre-refinement literal values. The scaled radii now live only on the selector list that also receives corner-shape, redeclaring the tokens locally so the widened radius stays contained to opted-in surfaces and their descendants. Menu panels needed their derived --menu-radius/--menu-item-radius redeclared too (a custom property's nested var() resolves relative to where it's declared, not where it's read, so redeclaring only --radius-md wouldn't reach them), and wa-dropdown/wa-popover/wa-select scale on the host rather than the ::part() panel since slotted menu items inherit from the light-DOM host, not from the shadow part they render inside. Adds regression coverage for the excluded consumer and the exported MCP theme tokens to corner-shape.browser.test.ts. * fix(ui): stop redeclared corner-curvature radius tokens from leaking to nested descendants Round 1 fixed the :root-level leak by redeclaring --radius-* as an inheritable custom property on each opted-in container instead. That still leaks: any non-opted descendant nested inside an opted surface inherits the container's redeclared token too. Proof: .settings-segmented nested inside .settings-group rendered 12.5px round instead of its canonical 10px, and .agent-chat__search-bar's own --radius-lg-derived corners doubled up incorrectly depending on ancestor nesting. Every opted selector now sets border-radius as a direct property computed from the scale, not an inheritable token — border-radius does not inherit, so nested non-opted descendants keep reading the untouched canonical --radius-* from :root. Each selector is specificity-doubled (`.card.card`) rather than !important, so it reliably outranks its own bare-class declaration in a later-loaded file without silently clobbering a genuinely more specific existing override elsewhere in the app (e.g. `.chat:has(> .agent-chat__search-bar)`, `.chat-task-detail__transcript > .chat-thread`) — both surfaced as regressions during this fix and are preserved by design now. The one exception is the generic wa-dropdown/wa-popover/wa-select ::part() panel selector, which by design must outrank dozens of concrete per-feature panel classes app-wide; a bare type selector can never out-specificity a class selector, so that rule keeps !important. --menu-item-radius at :root also serializes back to the byte-identical `var(--radius-sm)` from base 738b5cb in the unscaled fallback path; the derived panel-minus-padding formula now lives only in the scaled wa-dropdown/wa-popover/wa-select host redeclaration where it's needed. Adds a nested-inheritance regression case to corner-shape.browser.test.ts (.settings-segmented inside .settings-group) and a .settings-group entry to prove the container itself still scales. * fix(ui): pair scale and corner-shape on every corner-curvature selector ClawSweeper caught two more instances of scale and shape traveling apart: 1. .option-card__choice wasn't in the corner-curvature list at all, despite being a real nested member of the .option-card family (a button inside .option-card__choices inside .option-card, drawn with the same 14px --radius-lg step as .card/.settings-group). It kept its canonical 14px round corner even under the scale. 2. .slash-menu-item / .chat-reply-context-menu button / .chat-selection-popup button picked up the scaled radius from round 2 but never got corner-shape, so their corners grew without curving into a squircle — scale without shape, the same incoherence class as (1) in reverse. Decision on (2): items get corner-shape added (not scale removed). The panel they sit in is already squircle; an item whose radius grows but stays circular reads as an unrelated circle poking out of the panel's superellipse, not a coherent nested row. A final invariant pass over the full @supports block (every selector that sets a live border-radius must also set corner-shape, and vice versa) found one more forgotten member beyond the two reported: .agent-chat__search-bar scaled its own (bottom-only) radius but never carried corner-shape, same gap as the menu items. Fixed alongside the reported two. Every remaining selector in the block already pairs the two; the wa-dropdown/wa-popover/ wa-select host rule is the one correct exception, since it only carries custom properties for descendants and draws no border of its own. Test coverage now exercises each surface's real nested DOM instead of a synthetic flat selector: option-card.ts's actual button-inside-choices- inside-card structure, chat-composer-slash-menu.ts's item three levels below the panel, and chat-thread-interactions.ts's plain <button> item matched via descendant tag selector. Added a corner field to CornerCase so the harness can probe the correct physical corner (search-bar's bottom-left is its only non-zero corner) instead of universally reading top-left. All four new/changed cases are proven to fail on pre-fix base.css with the exact "radius scaled, shape stuck at round" (or, for option-card__choice, "not opted in at all") signature before the corresponding fix.
What Problem This Solves
Control UI corners are drawn as plain circular arcs, and the radius scale behind them is four unrelated literals. Two things follow from that.
A circular corner ends on a tangent: the curve stops and the straight edge begins at a visible break. At the radii this app uses, the corner reads tighter and harder than the value suggests, and the effect is strongest exactly where the surface is largest — approval dialogs, settings groups, option cards, the composer.
And the scale itself has no owner.
--radius-sm/md/lg/xlare independent values,--radiusrestated10pxbeside--radius-md, and--menu-item-radiusrestated6pxnext to a comment explaining that it is really "panel radius minus menu padding". Any future adjustment to the app's corner language means editing every one of them and hoping the relationships still hold.Why This Change Was Made
Every radius step now runs through a single knob,
--openclaw-corner-radius-scale, and where the engine can draw a superellipse the app opts into continuous corner curvature: the corner keeps curving into the edge instead of stopping on a tangent, and the 1.25 scale gives the arc back the visual weight the tangent break was taking away. Border, shadow, outline and overflow clipping all follow the drawn shape, so this stays a paint-level refinement — no layout or DOM changes.The whole refinement sits inside one
@supports (corner-shape: superellipse(1.5))block inui/src/styles/base.css. On an engine withoutcorner-shapethe block never applies: the scale stays1and every corner keeps today's radius and today's arc. That path is unchanged by construction, and it is asserted, not assumed — see Evidence.Two deliberate boundaries:
--radius-fullstays9999pxin both paths.--menu-item-radiusis now derived as--menu-radius - --menu-padding, which is the optical relation its own comment already documented (item edge stays parallel to the panel edge). It resolves to today's6pxunscaled and stays correct at any scale.Support matrix
Token values
corner-shape--radius-sm--radius-md--radius-lg--radius-xl--menu-radius--menu-item-radius--radius-fullSurfaces that pick up both the scale and the shape: approval/confirm dialog shells, the command palette, menu and popover panels (including
wa-dropdown,wa-popoverandwa-selectparts), cards, settings groups, option cards, agent tool cards, chat thread and bubbles, the composer, sidebar session rows, nav and list rows, buttons, and text inputs.User Impact
On Chrome and Edge 139 or newer the Control UI gets a softer, more continuous corner language across dialogs, menus, panels, the composer, sidebar rows and buttons, with pills and circular chrome deliberately untouched. Everywhere else the UI looks exactly as it does today — nothing to configure, nothing to opt into, and no way for the change to regress an unsupported browser.
Evidence
Screenshots below are before/after pairs composed at 1:1 pixel scale, light and dark, captured with headed Chromium 151 under Xvfb on a Blacksmith Testbox, driving the mocked Control UI (
pnpm dev:ui:mock). "Before" is the fallback path — the same page with the corner scale forced back to1and every corner returned toround, which is what an engine withoutcorner-shaperenders.Corner detail (
--radius-xlsurface, 20px → 25px)Surface families — dialog, card, option card, menu, sidebar row, buttons, pills, composer, input
Pills, chips and the status dot are identical on both sides — that is the intended exclusion, not a missed surface.
Chat
Settings
Computed styles from the same run
chromium=151.0.7922.34 corner_shape_supported=true.btn10px round12.5px superellipse(1.5).card14px round17.5px superellipse(1.5).settings-group14px round17.5px superellipse(1.5).option-card20px round25px superellipse(1.5).exec-approval-card14px round17.5px superellipse(1.5).agent-chat__input10px round12.5px superellipse(1.5).sidebar-recent-session10px round12.5px superellipse(1.5).nav-item10px round12.5px superellipse(1.5).pill9999px round9999px round.statusDot9999px round9999px roundTests and checks
ui/src/styles/corner-shape.browser.test.tsdrives real Chromium over the shipped stylesheets twice: once as shipped, and once with the@supportscondition rewritten to a value no engine implements. The second case is how the no-support path is proven rather than assumed — it asserts every surface back at10 / 14 / 20pxandround, including the pills. Both pass.ui/src/pages/chat/chat-responsive.browser.test.tspinned bubble, composer, transcript-search and gateway-menu radii to unscaled literals. Those assertions now read the live corner scale and multiply, so they hold on both paths; the menu item is asserted aspanel radius − menu padding, which is the invariant it was really protecting.pnpm test:ui— 659 files, 9458 tests, 1 skipped, green (Blacksmith Testbox, Linux, Node 24).pnpm lint:ui:styles(stylelint),tsgo -p tsconfig.ui.json, UI test typecheck shards, and oxlint on the touched files — all green on the same box.pnpm test:ui:e2eon that Testbox reported four failing files:ui/src/e2e/activity-run-inspector.e2e.test.ts,ui/src/e2e/chat-flow.follow-ups.e2e.test.ts,ui/src/e2e/chat-flow.models-reasoning.e2e.test.ts,ui/src/pages/secrets/secrets.e2e.test.ts. All four pass locally on this branch (30 tests, macOS, same Chromium build), and none of the failures is a geometry or radius assertion — they are a mobile scroll-height check, a notice ordering check, a model-select click intercepted mid-retry, and a dialog field timeout, i.e. load-sensitive flakes on a busy 4-vCPU VM that was also hosting the screenshot server. The confirming baseline run on the same box was killed (exit 137, out of memory) before it finished, so the pre-existing-versus-introduced classification rests on the local pass rather than a same-box baseline. Worth a clean e2e lane on CI before this leaves draft.Production delta is
+66 / −10lines in one file,ui/src/styles/base.css; everything else is tests.