Skip to content

improve(control-ui): continuous corner curvature with a radius scale - #124129

Merged
vyctorbrzezowski merged 5 commits into
mainfrom
brzezowski/control-ui-corner-curvature
Aug 15, 2026
Merged

vyctorbrzezowski merged 5 commits into
mainfrom
brzezowski/control-ui-corner-curvature

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

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/xl are independent values, --radius restated 10px beside --radius-md, and --menu-item-radius restated 6px next 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 in ui/src/styles/base.css. On an engine without corner-shape the block never applies: the scale stays 1 and 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:

  • The shape is opt-in per surface family, not universal. A superellipse flattens the ends of anything fully rounded, and pills, chips, avatars, status dots and circular icon actions are roughly a third of this app's corners. They keep true arcs. The block lists the shared surface families instead; leaving one out only keeps its current corner, which is the safe direction to fail.
  • Fully-rounded chrome is shape, not scale. --radius-full stays 9999px in both paths.

--menu-item-radius is 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's 6px unscaled and stays correct at any scale.

Support matrix

Engine Corners
Chrome / Edge 139+ continuous curvature, radii scaled ×1.25
Firefox, Safari, older Chromium today's radii, today's circular arcs

Token values

Token Today With corner-shape
--radius-sm 6px 7.5px
--radius-md 10px 12.5px
--radius-lg 14px 17.5px
--radius-xl 20px 25px
--menu-radius 10px 12.5px
--menu-item-radius 6px 8.5px
--radius-full 9999px 9999px

Surfaces that pick up both the scale and the shape: approval/confirm dialog shells, the command palette, menu and popover panels (including wa-dropdown, wa-popover and wa-select parts), 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 to 1 and every corner returned to round, which is what an engine without corner-shape renders.

Corner detail (--radius-xl surface, 20px → 25px)

Macro corner comparison, dark Macro corner comparison, light

Surface families — dialog, card, option card, menu, sidebar row, buttons, pills, composer, input

Surface gallery, dark Surface gallery, light

Pills, chips and the status dot are identical on both sides — that is the intended exclusion, not a missed surface.

Chat

Chat view, dark Chat view, light

Settings

Settings appearance, dark Settings appearance, light

Computed styles from the same run

chromium=151.0.7922.34 corner_shape_supported=true

Selector Fallback path Enhanced path
.btn 10px round 12.5px superellipse(1.5)
.card 14px round 17.5px superellipse(1.5)
.settings-group 14px round 17.5px superellipse(1.5)
.option-card 20px round 25px superellipse(1.5)
.exec-approval-card 14px round 17.5px superellipse(1.5)
.agent-chat__input 10px round 12.5px superellipse(1.5)
.sidebar-recent-session 10px round 12.5px superellipse(1.5)
.nav-item 10px round 12.5px superellipse(1.5)
.pill 9999px round 9999px round
.statusDot 9999px round 9999px round

Tests and checks

  • New ui/src/styles/corner-shape.browser.test.ts drives real Chromium over the shipped stylesheets twice: once as shipped, and once with the @supports condition 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 at 10 / 14 / 20px and round, including the pills. Both pass.
  • ui/src/pages/chat/chat-responsive.browser.test.ts pinned 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 as panel 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:e2e on 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 / −10 lines in one file, ui/src/styles/base.css; everything else is tests.

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.
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 15, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 8:50 AM ET / 12:50 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 3 items remain

The 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
Reviewed head: 6279139c07d666dcd42674bc04f66540cef0f7a3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The current head resolves the prior concrete selector gaps and is supported by direct browser rendering proof; remaining work is product acceptance and exact-head CI.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR provides after-fix Chromium screenshots, computed-style results, and an added browser test covering the enhanced and forced-fallback paths.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR provides after-fix Chromium screenshots, computed-style results, and an added browser test covering the enhanced and forced-fallback paths.
Evidence reviewed 6 items Current PR implementation: The feature gate sets the scale only when corner-shape is supported, then applies direct, non-inheriting radius and shape rules to the selected surface families.
Prior findings addressed: The current head includes both the real option-card choice selector and the scaled menu-item selectors with corner-shape, addressing the prior paired-scale/shape gaps.
Caller and sibling boundary: Option-card choices are actual button children with their own 14px radius, while the gateway-menu panel and item consume the shared menu-radius relationship; the PR’s targeted rules cover both boundary shapes.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should supported Chromium-family browsers receive the broader superellipse-and-scaled-radius visual language while unsupported engines retain today’s circular corners? Accept the supported-browser treatment: Approve the intentional Chromium-family visual refinement after required checks are green on the current head.

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

  • Resolve merge risk (P1) - On browsers supporting corner-shape, this intentionally changes the default visual language across shared surfaces and Web Awesome menu/select parts; a UI owner should explicitly accept that browser-specific presentation before merge, and required CI is not yet green on the exact head.
  • Complete next step (P2) - A UI owner must decide whether to adopt the supported-browser visual language; no narrow repair is currently indicated.
Agent review details

Security

None.

PR surface

Source +159, Tests +373. Total +532 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 159 0 +159
Tests 2 378 5 +373
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 537 5 +532

Review metrics

Metric Value Why it matters
Production versus test delta production +158/-0; tests and test configuration +379/-5 The implementation is concentrated in the shared stylesheet, while most of the change supplies browser-style regression coverage for supported and fallback behavior.

Merge-risk options

Maintainer options:

  1. Accept the browser-specific visual split (recommended)
    Approve the scoped Control UI presentation change once exact-head required CI is green.
  2. Keep the existing visual baseline
    Pause or close the PR if maintainers do not want default Control UI geometry to vary by browser capability.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is a non-urgent Control UI presentation enhancement.
  • merge-risk: 🚨 compatibility: Supported-browser users will receive changed default corner geometry across shared UI surfaces while other engines retain the existing appearance.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR provides after-fix Chromium screenshots, computed-style results, and an added browser test covering the enhanced and forced-fallback paths.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR provides after-fix Chromium screenshots, computed-style results, and an added browser test covering the enhanced and forced-fallback paths.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR provides after-fix Chromium screenshots, computed-style results, and an added browser test covering the enhanced and forced-fallback paths.

Evidence

What I checked:

  • Current PR implementation: The feature gate sets the scale only when corner-shape is supported, then applies direct, non-inheriting radius and shape rules to the selected surface families. (ui/src/styles/base.css:314, 6279139c07d6)
  • Prior findings addressed: The current head includes both the real option-card choice selector and the scaled menu-item selectors with corner-shape, addressing the prior paired-scale/shape gaps. (ui/src/styles/base.css:325, 6279139c07d6)
  • Caller and sibling boundary: Option-card choices are actual button children with their own 14px radius, while the gateway-menu panel and item consume the shared menu-radius relationship; the PR’s targeted rules cover both boundary shapes. (ui/src/styles/option-card.css:36, 6279139c07d6)
  • Fallback and token coverage: The added browser test reads the shipped CSS, disables the support condition for its fallback fixture, checks supported and unsupported computed corner styles, and confirms the MCP-app root radius tokens remain canonical. (ui/src/styles/corner-shape.browser.test.ts:293, 6279139c07d6)
  • Current main remains unchanged: Current main still defines the unscaled radius and menu tokens and has no corner-shape support block, so it does not already provide this requested visual behavior. (ui/src/styles/base.css:229, c98ae0f99cb2)
  • Feature history: The shared menu geometry dates to the transient-menu design-system work, and current radius lines trace through recent Control UI maintenance; this supports routing visual acceptance to the area’s established contributors. (ui/src/styles/base.css:237, 8fa897a3f151)

Likely related people:

  • steipete: Authored the merged transient-menu geometry work and recent maintenance that carries the current radius-token surface. (role: recent Control UI design-system contributor; confidence: high; commits: 8fa897a3f151, 843017073cc2; files: ui/src/styles/base.css, ui/src/styles/chat/layout.css)
  • vyctorbrzezowski: Has prior merged Control UI styling work and is familiar with the affected menu and visual-system area beyond this proposal. (role: recent Control UI contributor; confidence: medium; commits: 24bbb416b559, 17e11e43415e; files: ui/src/styles/base.css, ui/src/styles/option-card.css)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain green required checks on the current head.
  • Have a Control UI owner confirm the intended supported-browser visual split.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-15T09:20:01.158Z sha 16a74a4 :: found issues before merge. :: [P2] Limit the scale to opted-in surfaces
  • reviewed 2026-08-15T09:27:14.274Z sha 16a74a4 :: found issues before merge. :: [P2] Scope the radius scale to opted-in surfaces
  • reviewed 2026-08-15T12:02:22.321Z sha 196cd72 :: needs changes before merge. :: [P2] Apply the enhanced shape to option-card choices | [P2] Canonicalize the temporary browser-fixture path
  • reviewed 2026-08-15T12:31:09.486Z sha f269a89 :: found issues before merge. :: [P2] Apply the enhanced shape to option-card choices | [P2] Apply corner-shape to scaled menu items

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 09:24
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.
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 2925065 into main Aug 15, 2026
323 of 325 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/control-ui-corner-curvature branch August 15, 2026 17:48
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant