Skip to content

ui: share one radio component across single-choice controls - #194145

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/radio-component
Nov 6, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/radio-component

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Radios in the Control UI had drifted apart. There were six radio surfaces with five sizes (13, 14, 16, 18 and 19px), three ring colors, two checked styles (an inset accent dot and a browser-default ring) and one radio that showed a checkmark. The question card's radio looked like a checkbox. Its own-answer row was square in chat but round on the question page. The keyboard handling was copied into each group, and only some copies supported Home/End or right-to-left layouts.

User Impact

  • The migrated radio controls share a 16px ring and, when checked, an accent fill with a contrasting dot that follows the theme.
  • The question card shows a radio instead of a checkmark, and its own-answer row uses the same mark.
  • Native radios (device pairing, secrets, new section) keep native focus, labels and arrow keys. They gain a visible focus ring on the mark.
  • Arrow keys, Home and End now work the same in every custom radio group. Left and right follow reading direction.
  • System high-contrast modes keep selection and keyboard focus visible.

Why This Change Was Made

ui/src/components/solid/radio.tsx adds:

  • Radio: a native <input type="radio"> inside its <label>. The input itself draws the mark.
  • RadioMark: the same mark for rows that are role="radio" buttons. The row passes checked and disabled.
  • nextRadio(event, radios): Arrow, Home and End movement for custom radio groups. Callers keep their own selection logic.

Changed:

  • Move session dialog.
  • Mobile Versions sheet.
  • Question card radios and the own-answer row. Multi-select checkboxes are unchanged.
  • New section scope.
  • Secrets access mode.
  • Device pairing setup type.
  • Option card and dashboard filter now share the same arrow-key logic. Their visuals are unchanged.
  • Also removed an invalid aria-pressed attribute from the move dialog's role="radio" rows.

Left alone on purpose:

  • Segmented controls: settings segmented, composer Speed/Access and side-panel dock.
  • Menu menuitemradio checkmarks and the dashboard filter's menu-style rows.
  • Option card's whole-card choice.
  • Checkboxes, toggles and icon buttons.

Radios stay circular in square-corner themes such as CRT, because a square mark reads as a checkbox.

Evidence

All images come from pnpm dev:ui:mock by clicking through the UI. In Absolutely light unless noted.

Scenario Before After
Question card · Review selected · desktop · Absolutely light
Move session dialog · This computer selected, Mac Studio disabled · desktop · Absolutely light
State Screenshot
New section dialog · native radios, My sessions selected, name field focused · desktop · Absolutely light
Versions sheet open · current version selected · 390 · Absolutely light
Connect a device dialog · Full access selected · desktop · Absolutely dark
Add secret dialog · Agent-readable environment selected · desktop · CRT dark

Validation passed: 76 focused unit tests, both affected cloud-placement E2E scenarios, UI typechecking, targeted lint/stylelint, formatting, and diff checks. Forced-colors selection and keyboard focus were verified in the existing mock app’s device-pairing dialog using Chromium media emulation. Normal-theme rules are unchanged by that correction.

CI for the reviewed head d11d74a.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Nov 6, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 8dd41fc into main Nov 6, 2026
92 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/radio-component branch November 6, 2026 13:49
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…#194145)

* ui: share one radio component across single-choice controls

* fix(ui): preserve radio contrast and update selection assertions
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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant