Skip to content

improve(ui): standardize the segmented control - #190395

Merged
vyctorbrzezowski merged 5 commits into
mainfrom
brzezowski/standardize-segmented-control
Nov 2, 2026
Merged

vyctorbrzezowski merged 5 commits into
mainfrom
brzezowski/standardize-segmented-control

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The same control rendered four ways. Segmented controls measured 32px, 38px, 38.6px and 42px on desktop, and 38px, 42px, 50px and 57px on phone. Selected segments were a neutral lift, a terracotta tint or a terracotta fill depending on the page. On phone, overflow-wrap: anywhere could split a label mid-word, as in "For/m" on Advanced.

User Impact

Segmented controls look and behave the same across Usage, Activity, Skill workshop, Sessions filters, Plugins and Settings:

  • Height always equals the surrounding control height: 32px on desktop, and on phone the 38px or 44px of the inputs beside it.
  • Selected is always the neutral lift. CRT's surface tones sit too close together, so its lift is a stronger neutral. Form/Raw and the Usage card toggles no longer use terracotta, which stays reserved for primary actions.
  • Radius stays --radius-md with a concentric inner corner, so square themes stay square and no radius shrinks.
  • Narrow widths move whole segments to a new row. Labels only break between words.
  • A stretched or wrapped track shares its spare width between segments, so it never shows an empty run. Phone settings rows such as Model Catalog Mode inherited that empty track from main, up to 209px of it.

No capability or copy changes.

Why This Change Was Made

Each instance was judged in its page; the differences that changed were accidents. variant="accent" and variant="primary" are removed from SettingsSegmented. settings-segmented--compact stays as the one deliberate second size, for the composer model menu. Plugin settings tabs keep tab semantics and take the same surface. The fake one-button segmented control behind Usage's Reset becomes a plain small button.

Left alone on purpose: hub tabs and skill workshop detail tabs (navigation, not segmented), theme, text-scale, background, secret-mode and sharing option cards (they carry previews or descriptions), command palette and workspace filter chips, the avatar picker (moving it would shrink its 20px radius), the session menu communication picker (its selected state isn't reachable in the mock, so it wasn't changed unseen), and the phone chat header switch (its own sliding thumb).

Overlap: this also resolves the "For/m" wrap on Advanced, which another PR covers. Page images show today's top bar until the header PR lands.

Evidence

Captured from the mock data layer with real navigation. Absolutely light and dark, CRT, and 390px.

Usage, Absolutely light

Before After

Advanced at 390px, Absolutely dark

Before After

Advanced, CRT (square stays square)

Before After

Plugin settings tabs, not pictured: 42px with 11px text becomes the same surface at 32px on desktop and 44px on phone, with 12px text.

Real Safari (After), default theme

Usage, 580px window Advanced, 390px window

Reached by navigation only, so no OS clicks. Safari shows the mock's default theme, not Absolutely, and the 580px window uses the narrow layout, so desktop-width Safari isn't covered.

Mid-word check at 320px and 390px across Usage, Activity, Skill workshop, Advanced, Talk, Skills, Models, Appearance, Plugins and Security: no label split and no overflow. A new browser test covers this, and fails when the old overflow-wrap rule is restored.
Empty-track check on these pages and the other settings pages at 320px and 390px: none, against 11 instances at 390px before this fix. A second browser test covers this, and fails without the rule.

Desktop width check at 1280px, 27 controls on 13 pages: the spare-width rule changes none. Against main, only four differ, all from removing the variants: the two Usage card toggles and Form/Raw by about 1px, and the plugin tabs by 19px from the larger text.

Local checks: oxfmt, stylelint, oxlint, tsgo:ui, ui:check-performance:base, and the settings, usage, config, sidebar filter, session menu and skill workshop unit and browser tests pass. presentation-primitives.e2e hit a goto timeout twice on a heavily loaded machine, then passed.

Not verified:

  • Usage session detail (Per turn/Cumulative, Total/By type, and the Reset button). Selecting a session in the mock crashes the panel with Cannot read properties of undefined (reading 'length'), on unmodified main too.
  • The compact size in the composer model menu, because the mock's model has no context-window options. Its size rules are unchanged; it gains the shared centring and minimum height.
  • Translated long labels, because the locale didn't apply in the mock. The browser test uses long German strings instead.

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

clawsweeper Bot commented Nov 1, 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR standardizes segmented-control sizing, selection colors, corner radii, and narrow-screen label wrapping.

Example: Advanced settings at a 390px viewport.

  • Before: The Form label wraps into “For” and “m” inside a terracotta selection.
  • After: Form stays whole inside a neutral selected segment.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Clear visual evidence supports a focused change, but the introduced accessibility defect blocks merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected browser screenshots exercise real Control UI navigation with mock data and show the changed Usage, Advanced, CRT, and plugin-tab presentation; the body discloses unverified Safari, session-detail, compact-menu, and translated-label scenarios.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Equivalent selectors have inconsistent heights and selected colors, and Form can split mid-word on a phone.
Reason: The maintainer-authored proposal explicitly approves neutral visual standardization and documents intentional exclusions, while preserving selection semantics.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored PR provides useful visual consistency, but introduces a forced-colors keyboard-focus regression in plugin settings tabs.

Priority: P2
Reviewed head: 1f1cd64ef0401adce4ba3de8ae7b5c1a6089afbe

Before merge

  • Restore the plugin-tab focus outline in forced colors (P2) - With Windows forced colors active, keyboard navigation to Installed or Advanced in plugin settings loses its visible focus indicator. This new selector sets outline:none and replaces it with a box shadow, which forced colors suppresses. Its specificity exceeds the existing .hub-tab:focus-visible forced-colors rule in hub-tabs.css, and the forced-colors block below covers only .settings-segmented controls. Add a matching forced-colors outline override for these tab classes and cover keyboard focus in the browser regression.

Findings

  • [P2] Restore the plugin-tab focus outline in forced colors — ui/src/styles/settings-controls.css:149-151

Tests

  • Missing end-to-end proof: The supplied visual proof does not exercise plugin-tab keyboard focus with forced colors active.
Agent review details

How this fits together

Control UI pages pass choices and callbacks to shared Solid controls; shared CSS determines their appearance while existing page owners handle selection changes.

flowchart TD
  A[Settings and Usage pages] --> B[SettingsSegmented]
  C[Plugin settings] --> D[HubTabs]
  B --> E[Shared control styles]
  D --> E
  B --> F[Existing selection callbacks]
  D --> F
Loading

Technical review

Best possible solution:

Retain the shared presentation change and restore a winning forced-colors focus outline for plugin settings tabs.

Do we have a high-confidence way to reproduce the issue?

The supplied screenshots demonstrate the original visual inconsistency; source inspection establishes the introduced focus-outline failure without executing target code.

Is this the best way to solve the issue?

Reusing the existing controls and deleting redundant variants is appropriately small; the new tab focus styling needs the existing forced-colors safeguard.

Full review comments:

  • [P2] Restore the plugin-tab focus outline in forced colors — ui/src/styles/settings-controls.css:149-151
    With Windows forced colors active, keyboard navigation to Installed or Advanced in plugin settings loses its visible focus indicator. This new selector sets outline:none and replaces it with a box shadow, which forced colors suppresses. Its specificity exceeds the existing .hub-tab:focus-visible forced-colors rule in hub-tabs.css, and the forced-colors block below covers only .settings-segmented controls. Add a matching forced-colors outline override for these tab classes and cover keyboard focus in the browser regression.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47cb40a3b3f0.

Provenance checked

  • Contextual segmented-control variants changes intended behavior with a stated reason (517e993: The earlier consolidation preserved distinct visual, focus, disabled, and callback contracts rather than redesigning them.)
  • Solid segmented rendering keeps the original intent (eca633a: The migration established one Solid owner with native radio and button semantics.)
  • Phone Settings sizing and wrapping changes intended behavior with a stated reason (5413688: Phone and embedded Settings gained larger controls and responsive containment; this PR explains aligning the complete segmented track with adjacent controls and preserving whole words.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/hub-tabs.browser.test.tsx src/components/settings-ui.browser.test.tsx
  • pnpm lint:ui:styles
  • Verify plugin settings keyboard focus with forcedColors active: focused tabs retain a visible outline while boxShadow is none.
  • git diff --check

What I checked:

  • Pinned introduced change: The introduced diff removes presentation variants and their callers while retaining radio, button, and tab interaction owners. (ui/src/components/solid/settings-ui.tsx:536, 1f1cd64ef040)
  • Introduced focus regression: The new plugin-tab selector sets outline:none with greater specificity than the forced-colors outline in hub-tabs.css; its replacement box shadow disappears in forced colors. (ui/src/styles/settings-controls.css:149, 1f1cd64ef040)
  • Reachable plugin settings consumer: Plugin settings renders Installed and Advanced through HubTabs with carapace enabled, producing the exact classes targeted by the new focus rule. (ui/src/pages/plugins/settings-inventory.tsx, 1f1cd64ef040)
  • Visual proof inspected: Inspected all four before/after image pairs: Usage light, Advanced phone dark, Advanced CRT, and plugin settings dark. They show the intended neutral selection, intact Form label, and retained square theme. The first four images were read locally; remaining GitHub images were inspected in memory after scratch writes failed because the filesystem was read-only. (1f1cd64ef040)
  • Earlier design and current owner direction: refactor(ui): share segmented control rendering #140699 deliberately preserved contextual visuals and interaction contracts. This maintainer-authored PR explicitly explains replacing the visual variants while preserving distinct interaction semantics. (ui/src/styles/settings-controls.css, 517e9935ff9f)
  • Related component inventory: Control UI: consolidate segmented controls #151497 tracks segmented-control consolidation and preserving keyboard focus; its scope overlaps this PR without establishing complete resolution.

Likely related people:

  • Peter Steinberger: Raw commit eca633a adds ui/src/components/solid/settings-ui.tsx:394 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eca633a8801b; files: ui/src/components/solid/settings-ui.tsx)

PR surface

Source -44, Tests +32. Total -12 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 9 76 120 -44
Tests 3 45 13 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 121 133 -12

Labels

Label changes:

  • add P2: Useful UI consistency work has a concrete accessibility regression limited to forced-colors keyboard navigation.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Useful UI consistency work has a concrete accessibility regression limited to forced-colors keyboard navigation.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 1, 2026, 9:29 AM ET / 14:29 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit 01a6148 into main Nov 2, 2026
9 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/standardize-segmented-control branch November 2, 2026 14:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
Consolidate segmented control variants on the shared neutral surface, preserving full-word labels and native selection, busy and disabled behavior. Keep current main responsive help controls and CRT status colors.

Validated with 21 focused tests, UI and UI-test typechecks and touched-file checks. Original approved visual evidence retained.
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 P2 Normal backlog priority with limited blast radius. 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. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant