Skip to content

ui: shared IconButton for composer, refresh and Sessions toolbar - #194140

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

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/icon-button-component

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Icon-only controls used separate box, glyph, hover and focus rules. This adds a shared IconButton and class contract, migrates composer dismiss controls and the Sessions toolbar, and routes shared RefreshButton consumers through it. Approved glyph sizes, theme radii, attachment badge artwork, and phone hit targets are preserved.

The icon prop now accepts a registered icon name or a non-string Solid element, so rendering needs no unchecked cast. Duplicate attachment CSS is consolidated. The unavailable-search test checks the component-owned tooltip while retaining disabled, recovery, and negative callback assertions.

Validation:

  • UI typecheck, changed-file lint, CSS lint, formatting, and diff checks pass. Existing reactive lint warnings remain.
  • 19 focused Sessions tests pass (1.26s), plus four attachment/reply/refresh consumer tests (4.08s). No new tests or test-line growth; the actual CI merge passes its test-line ratchet.
  • The previously failing WebKit native-link modal-menu test passes its focused replay (1.62s). Original job logs were unavailable; the preceding shard order could not be reproduced. This replay does not establish a fix, and no assertion was weakened.
  • Independent review of the full corrected diff found no actionable defects. No full UI suite was run. Current hosted CI remains pending.

One production comparison against the current CI base found chat boot JS at 1,289,167/1,289,137 bytes gzip (+30 over the ceiling; +238 from base). CSS and the other asset budgets pass. Duplicate CSS was consolidated; the remaining JS budget exception is reserved for the maintainer. No budgets were raised.

Existing visual evidence was inspected and retained; these corrections do not change the approved appearance.

Scenario Before After
Composer reply dismiss X · hover · 1280 light 01-composer-before 02-composer-after
Sessions toolbar refresh · hover · 1280 light 03-sessions-toolbar-before 04-sessions-toolbar-after
Sessions toolbar refresh · hover · 390 light 07-sessions-390-before 08-sessions-390-after
State Screenshot
Composer reply dismiss X · hover · 1280 dark 05-composer-dark
Composer reply dismiss X · focus · 1280 CRT dark 06-composer-crt-focus

@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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 6, 2026
@clawsweeper

clawsweeper Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR introduces a shared icon button for composer dismissals, refresh actions, and the Sessions toolbar.

Example: Hover over Refresh in the desktop Sessions toolbar.

  • Before: The toolbar uses an 18px glyph with no hover ground.
  • After: The toolbar uses a 14px glyph with the shared hover ground and button geometry.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Strong visual proof supports the intended result, but attributable assertion-safety and Sessions test failures prevent a ready-to-merge verdict.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The supplied Control UI screenshots exercise the changed visual owner through rendered composer and Sessions controls, showing shared hover treatment, desktop and 390px layouts, dark mode, and CRT keyboard focus.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Icon-only actions vary in size, hover treatment, focus, and disabled appearance across neighboring UI surfaces.
Reason: The maintainer-authored direction consolidates repeated presentation behavior while retaining domain callbacks and justified attachment and primary-action exceptions.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored PR open: the shared control has a coherent purpose and convincing visual evidence, but two attributable validation failures need focused repairs.

Priority: P3
Reviewed head: bafe3913a88356edeaa4f95cf6c207fe85f33c2d

Before merge

  • Remove the unchecked icon-name assertion (P2) - The new props.icon as IconName assertion has no SAFETY justification and introduces a counted assertion into a new file with no baseline allowance. The required assertion-safety CI step fails, consistent with the scanner's handling of this exact expression. Narrow the icon prop contract so string values are typed as IconName and the JSX alternative cannot broaden them back to arbitrary strings, then pass the narrowed value without a cast.
  • Update the unavailable-search test for the tooltip migration (P2) - Migrating this trigger to IconButton adds an openclaw-tooltip wrapper even when transcriptSearchAvailable is false. The existing Sessions test explicitly expects no tooltip ancestor, and checks-ui (2/3) fails at view.test.ts:741 on this head. Update that test alongside the intentional migration, retaining its disabled-control, visible reconnect-status, and recovery assertions rather than pinning the former wrapper structure.

Findings

  • [P2] Remove the unchecked icon-name assertion — ui/src/components/solid/icon-button.tsx:67
  • [P2] Update the unavailable-search test for the tooltip migration — ui/src/pages/sessions/transcript-search-view.tsx:105-109
Agent review details

How this fits together

Control UI renderers pass labels, icons, state, and callbacks into button primitives that produce accessible native controls styled by shared and page-specific CSS.

flowchart TD
  A[Composer controls] --> D[IconButton]
  B[RefreshButton] --> D
  C[Sessions toolbar] --> D
  C --> E[Popover trigger classes]
  D --> F[Native button and tooltip]
  E --> G[Shared icon button CSS]
  F --> G
Loading

Technical review

Best possible solution:

Keep the shared primitive, make its icon contract type-safe, and update the affected Sessions test.

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

The supplied before/after screenshots establish the visual variation; this review ran no product code or tests.

Is this the best way to solve the issue?

A shared visual primitive fits the requested outcome, preserves existing action owners, and needs no additional state or abstraction.

Full review comments:

  • [P2] Remove the unchecked icon-name assertion — ui/src/components/solid/icon-button.tsx:67
    The new props.icon as IconName assertion has no SAFETY justification and introduces a counted assertion into a new file with no baseline allowance. The required assertion-safety CI step fails, consistent with the scanner's handling of this exact expression. Narrow the icon prop contract so string values are typed as IconName and the JSX alternative cannot broaden them back to arbitrary strings, then pass the narrowed value without a cast.
    Confidence: 0.99
  • [P2] Update the unavailable-search test for the tooltip migration — ui/src/pages/sessions/transcript-search-view.tsx:105-109
    Migrating this trigger to IconButton adds an openclaw-tooltip wrapper even when transcriptSearchAvailable is false. The existing Sessions test explicitly expects no tooltip ancestor, and checks-ui (2/3) fails at view.test.ts:741 on this head. Update that test alongside the intentional migration, retaining its disabled-control, visible reconnect-status, and recovery assertions rather than pinning the former wrapper structure.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Refresh button rendering changes intended behavior with a stated reason (24a860c: Provide a shared refresh action with stable dimensions, accessible naming, busy indication, and existing page callbacks.)
  • Composer context dismiss controls changes intended behavior with a stated reason (918c4c6: Integrate composer context strips while preserving readable content and enlarged touch dismissal targets; subsequent shared-style refactors retained these contracts.)
  • Attachment removal badge keeps the original intent (caf5be6: Give composer attachments consistent removal controls while retaining image-readable badges and existing recovery behavior.)
  • Sessions phone toolbar keeps the original intent (49f60db: Keep search, transcript search, refresh, and filtering together on phones while preserving readable session rows.)
  • Reply preview attribution keeps the original intent (9e59d23: Resolve reply authors through existing transcript attribution and defer the optional preview module outside cold boot.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:assertion-safety
  • pnpm --dir ui test src/pages/sessions/view.test.ts --project unit
  • pnpm lint:ui:styles
  • pnpm ui:check-performance:base 9f5e817

What I checked:

  • Pinned introduction and current main: Reviewed the introduced merge-base-to-head hunks; fetched main retains the original RefreshButton and has no IconButton module. (ui/src/components/solid/refresh-button.tsx:5, bafe3913a883)
  • Visual behavior inspected: Inspected all eight linked screenshots: composer before/after, Sessions desktop before/after, dark composer, CRT keyboard focus, and Sessions at 390px before/after. (bafe3913a883)
  • Patch-caused Sessions test failure: The checks-ui (2/3) annotation shows view.test.ts:741 failing because the newly migrated transcript-search button now has an openclaw-tooltip ancestor. (ui/src/pages/sessions/view.test.ts:741, bafe3913a883)
  • Assertion-safety failure: The new component introduces an unannotated IconName assertion; the assertion-safety scanner counts this exact form, and CI reports assertion-safety failed. (ui/src/components/solid/icon-button.tsx:67, bafe3913a883)
  • Remaining CI attribution is unresolved: Annotations report a WebKit native-link menu spacing failure and chat boot gzip of 1259.0 KiB against 1258.9 KiB; changed lint also failed. Raw logs redirect to a blocked Azure storage host, so these failures were not established as inherited or patch-caused. The aggregate gate reflects failed jobs. (bafe3913a883)
  • Existing owners and intended behavior: Merged history establishes RefreshButton's stable size, accessible name, busy state, and page callbacks; the new component retains that wrapper and its callbacks while intentionally changing the visual skin. (ui/src/components/solid/refresh-button.tsx:5, 24a860c9e7d9)

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 24a860c adds ui/src/components/solid/refresh-button.tsx:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 24a860c9e7d9; files: ui/src/components/solid/refresh-button.tsx)
  • Patrick Erichsen: Raw commit 9e59d23 adds ui/src/pages/chat/components/chat-composer-reply-preview.tsx:47 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9e59d23aff4d; files: ui/src/pages/chat/components/chat-composer-reply-preview.tsx)

PR surface

Source +113. Total +113 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 16 278 165 +113
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 16 278 165 +113

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P3: This is visual consistency and internal component cleanup, with no established urgent user workflow failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is visual consistency and internal component cleanup, with no established urgent user workflow failure.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦞 diamond lobster and patch quality is 🦪 silver shellfish.
  • 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 6, 2026, 8:29 AM ET / 13:29 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit 345120f into main Nov 6, 2026
88 of 91 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/icon-button-component branch November 6, 2026 18:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…nclaw#194140)

Share the existing icon-only button styling and interaction contract across Control UI callers, preserving native button behavior, disabled states, and tooltips.

Co-authored-by: Vyctor H. Brzezowski <[email protected]>
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 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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