Skip to content

refactor(ui): port shared pickers, dialogs, and toast to Solid 2 - #170387

Merged
steipete merged 35 commits into
mainfrom
solid2/w-prim-c2
Oct 13, 2026
Merged

steipete merged 35 commits into
mainfrom
solid2/w-prim-c2

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Shared pickers, dialogs, and toast still depend on Lit while the Control UI moves to Solid 2.

User Impact

These controls retain selection, keyboard navigation, dialog focus, and toast behavior through the existing tags and service APIs. The agent menu adopts the shared primitive’s spacing and focus ring.

Why This Change Was Made

Port the shared selection controls, confirmation/input dialogs, and toast renderer from Lit to Solid 2. Each registered tag has one implementation behind defineSolidBridge; existing tags, classes, callbacks, routes, and selectors remain usable by Lit consumers. Agent registration and the toast view retain their lazy boundaries.

The shared menu adapter owns navigation, selection, and dismissal. Pickers add listbox content and consume the menu’s lifecycle callbacks, including a six-line onAfterShow interface needed to reveal the accepted opening focus target after animation. Native overlays retain vetoable dismissal and modal focus restoration. Domain owners remain plain TypeScript. The toast service retains FIFO ordering, paused timeouts, modal reparenting, and dismissal reasons; a separate synchronous host registration keeps its renderer lazy.

Coupled consumers use native menu events and observable readiness. Focus fixes cover keyboard reopening, selected-row visibility, nested Escape, and the sidebar focus trap’s delegated-event target. ArrowUp preserves an enabled stored selection, including the empty value, and falls back to the last enabled row only when that selection is missing or disabled; the native keyboard regression covers all four cases. Layout fixes preserve low-positioned menu height and command-palette alignment. Tests also preserve successive notices after the toast host moves into a shadow-root modal. The ambient JSX picker declaration uses its existing DOM tag contract to avoid a registration-module import cycle.

Evidence

All local files ran separately with one worker. Browser evidence includes Chromium and WebKit for every overlay. The latest integration adopts main’s Menu content-entry renderer and broader attributes unchanged, retaining only the required lifecycle callback.

Contract Evidence
Select/multi-select Select: 21/21 per browser; multi-select: 14/14 per browser. Lower-edge and late-stylesheet regression passes both.
Agent/model/appearance/emoji pickers Agent: 12/12 per browser; legacy/Solid model: 4+3 per browser; decision model: 5/5 per browser; appearance: 4/4 per browser; emoji: 1/1 per browser.
Dialogs and toast Confirmation/input: 7+7 unit cases; confirmation: 2/2 per browser. Toast: 18 unit cases, 5/5 per browser.
Latest main integration 56 browser cases: agent 12+12, menu lifecycle 10+10, native menu contracts 6+6. UI types, typed lint, and formatting passed. Browser command walls: 77.25/63.96s, 53.65/25.17s, 26.15/28.90s respectively.
Full settings and consumer flows Locale 2/2, appearance defaults 7/7, transient theme surfaces 6/6; earlier decision-model 1/1 and agent-selector 4/4. Composer focus 2/2; palette persistence/Escape 1/1. Relevant coupled unit and browser results retained below.
Coupled tests Sidebar sessions 154/154 (192.09s); archive outcomes 14/14 (84.24s), tree archive 2/2 (159.24s); palette draft 28/28 (51.32s); nested content 12/12 (22.36s); cold-load E2E 2/2 (180.06s).
Test fixture repairs Sidebar frame scheduling retains ordinary microtask settlement and yields recurring frames: 37/37 affected tests. Agent-creation filesystem fixture: 24/24; command wall 961.06s, dominated by cold compilation/setup/cleanup.
Type-cycle repair Exact Madge check: zero cycles (491.96s); UI types: pass (89.53s); formatting: pass (1.22s). Complete-context independent P0–P2 review: scoped-clean.
Same-host startup comparison Base 06001d846eefe: 343,409 → 343,176 B gzip (-233 B); 8 JS / 1 CSS requests on both sides. Both strict checks pass the 374,285 B / one CSS ceiling. Base/head builds: 124.21/118.22s. CSS: 49,071 → 49,184 B.
Current same-runner performance CI job 115449024965 passes (138s), comparing tested merge 8b80a4af with base 52665817. Candidate startup: 348,601 B gzip, 8 JS / 1 CSS requests; CSS 49,481 → 49,590 B (+109). Measured base startup JS is not printed, so no fresh startup-JS delta is claimed. Chat/New route boot JS grows by 28,381/30,600 B; request counts stay 30/27 and all enforced budgets pass.
Visual proof Ten inspected synthetic before/after composites plus four command-palette captures embedded below.
Independent review Port, ownership/focus repairs, coupled fixtures, main integration, and the final type-only fix reviewed. No accepted actionable P0–P2 findings remain.

The startup comparison is the retained same-host measurement against main 06001d846eefe; fixed build metadata was identical on both sides. The subsequent main integration and test-only repairs are separately qualified below; these startup numbers are not a fresh measurement of the final head. Component markup/styles remain covered by the inspected visual evidence.

Local WebKit has ten baseline-matched failures, retained without weakened assertions: two grouped-decision picker Tab cases (390/1280px), three native menu Tab/navigation cases, one vetoed-popover outside-focus case, and four sidebar filter Tab cases. The matching baseline replays and exact names remain in the native review evidence. Chromium’s relevant focus cases pass. These failures are reported as failures, not green proof.

Touched production LOC: 13,465 → 13,904 (+439) across 42 files. Tests/support: 38,505 → 38,773; UI config: 469 → 478. Four obsolete assertion allowances are removed. The separate coupled backend fixture removes 27 net test lines. Growth is concentrated in the shared menu’s listbox support, typed DOM bridges, and the temporary adapters required by remaining Lit callers.

Current CI

Fresh ci:full run 38441350196 passed on 22ffa2a006af3042ff14834db40bac14f3b3f3b8: 50 successful jobs, 22 skips, no failures or cancellations. All 14 UI jobs passed (3 unit, 9 mocked E2E, 2 real-Gateway); the exact API-key edit/remove case passed in 26.808s, and real-Gateway shard 1 passed 17 files / 22 tests. CI wall: 1,231s, aggregate jobs: 17,615s; UI wall: 1,130s, aggregate jobs: 10,196s. This follows merging main 2e72813c450fb76402fbebe251c3a556347fc1c1 to recover an interrupted job. UI types passed in 35.51s; the automatic shell integration received a clean independent P0–P2 review against both parents. No dependency change or new local E2E run was needed. Native review and GitHub-only preparation completed for this exact head. Landed through documented confirmed-cancellation admin recovery as ecdc40dbcf9bfc4c083237fdfa69ea949088f27c, verified reachable from origin/main. A retry after GitHub reported MERGEABLE succeeded without changing the reviewed head or pushing. The native parent audit recorded that main advanced between admission and the actual merge parent; the completed receipt retains that fact. All selected-head CI passed; no failed-check exception was used.

The previous full run 38437049358, on 1a6a812b, passed every test assertion, including the formerly failing API-key CLI logout case (31.076s). The real-Gateway shard reported 17 files / 22 tests passed, then GitHub cancelled the job at its 20-minute limit after all recorded steps succeeded. Final accounting: 48 successful jobs, one cancelled job, one failed aggregate, 22 skips; CI wall 1,323s and aggregate job time 17,641s. UI wall 1,202s and job time 10,246s. Its auto-merge request was explicitly cancelled through native recovery before this push. This is a job timeout, not a recurring logout assertion failure; no test budget or assertion was changed.

Source inspection confirms that the CLI logout uses --yes, skips confirmation, and directly removes credentials then requests models.authRefresh; it never opens or awaits a browser dialog, picker, or toast. UI Remove key also dispatches directly; browser profile logout is a separate confirmation path. The earlier run 38429522467 emitted an unattributed post-handshake refresh warning while both scheduled main comparisons passed. The newer passing case does not establish a causal fix for that historical failure.

Main independently landed the roster clock repair in #170927; this branch adopts that fixture byte-for-byte, so it is absent from the final diff. Earlier run 38372028878 was fully green (50 passed / 22 skipped, all 14 UI jobs), before subsequent main integrations. Historical and current-head evidence are kept distinct.

Visual proof

Before is on the left; after is on the right. All ten pairs were captured on base 2f328736 and the migrated candidate, inspected in full, and contain only synthetic data. Later CI repairs and main integration changed lifecycle, focus handling, host registration, and test contracts; the pictured picker/dialog/toast markup and styles remain unchanged.

Accepted visual differences: the agent menu uses the shared primitive’s spacing and focus ring. Confirmation text drops an incidental leading blank line from the Lit template; explicit message line breaks remain intact.

Shared components: before (left), after (right)

Generic picker: before (left), after (right)

Model selection: before (left), after (right)

Agent selection: before (left), after (right)

Multi-select: before (left), after (right)

Language selection: before (left), after (right)

Appearance and emoji: before (left), after (right)

Input dialog: before (left), after (right)

Confirmation dialog: before (left), after (right)

Toast: before (left), after (right)

Supplemental command-palette settings proof preserves the same desktop and mobile alignment. All data is synthetic; before is baseline 2f328736 and after includes the picker layout correction.

Before: desktop command palette settings, synthetic main baseline

After: desktop Solid agent picker preserves settings alignment

Before: mobile command palette settings, synthetic main baseline

After: mobile Solid agent picker preserves settings alignment

Preserve public tags, picker selection contracts, modal focus, and toast FIFO through the Solid bridge. Keep the existing lazy entry points and render notification content on first use.\n\nLocal migration checkpoint; integrate the approved native overlay prerequisite from main before publication.
Keep the new Settings language-select API on the owned picker and retain the model picker direct Solid path. Reveal the selected agent after the menu entry animation completes; preserve the overlay owner toast render-update coverage.
Follow the shared menu initial focus policy after its entry animation, including the enabled fallback when the stored selection is disabled. The long-menu regression is proven red before the change and passes in Chromium and WebKit.
Find the connected toast host through the existing modal-layer registry after reparenting moves it beyond document queries. Extend the existing shadow dialog regression with a second notice; preserve the service queue and dismissal owner.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 12, 2026 23:34
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR moves shared Control UI pickers, dialogs, and toast rendering from Lit to Solid 2 while retaining their existing host tags and caller APIs.

Example: Open the Research agent selector in command-palette settings.

  • Before: Lit and Web Awesome render the selected agent and available choices.
  • After: Solid renders the same choices through the existing openclaw-agent-select host.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Visual and integration evidence supports the migration, but the confirmed keyboard-selection regression prevents readiness.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser captures cover the migrated controls and desktop/mobile command-palette integration; the complete body records built-app consumer scenarios, while the latest commit changes only test consumers.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Shared controls still depend on the legacy renderer while surrounding Control UI surfaces migrate to Solid.
Reason: Maintainer authorship establishes direction, and the cutover retains shared component boundaries and caller-owned effects.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep this PR open: the maintainer-directed migration is useful, but the previously reported ArrowUp selection regression remains.

Priority: P2
Reviewed head: f87ae5022d02ad7246e9d9e397b594db85582a6b

Before merge

  • Preserve the enabled selected choice when ArrowUp opens the picker (P2) - With enabled choices Alpha, Beta, and Gamma and value Beta, ArrowUp on the closed trigger initializes Beta through the menu subscription, then this callback overwrites the highlight with Gamma. Enter consequently commits Gamma. The base prioritizes the enabled stored choice and uses the last row only as a fallback. Preserve that priority and cover ArrowUp reopening with an enabled current value. This repeats the unresolved prior finding; the latest commit leaves this production hunk unchanged.
  • Complete next step - Resolve the GitHub-reported merge conflict and classify the collaborator-scroll failures in the current real-Gateway job against base evidence before assigning any additional code repair.
  • Explain or restore the original intent of Generic picker selection and search - 932ae87: Shared search preserves caller-owned selection, and the base opening logic prioritizes an enabled stored choice.

Findings

  • [P2] Preserve the enabled selected choice when ArrowUp opens the picker — ui/src/components/select-picker-view.tsx:123-126

Provenance

  • Generic picker selection and search changes intended behavior without addressing why it exists (932ae87: Shared search preserves caller-owned selection, and the base opening logic prioritizes an enabled stored choice.)
Agent review details

How this fits together

Shared controls receive caller-owned choices, values, and callbacks, render browser interactions, and return selections or dialog outcomes to existing domain owners.

flowchart LR
  A[Control UI callers] --> B[Existing host tags]
  B --> C[Solid bridge]
  C --> D[Solid views]
  D --> E[Menu and overlay owners]
  D --> F[Caller callbacks]
  G[Synchronous toast service] --> D
Loading

Technical review

Best possible solution:

Retain the Solid migration and restore enabled-selection priority when ArrowUp opens the shared picker.

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

Source establishes the ArrowUp regression by tracing opening publication, selected-value initialization, and the subsequent last-row override; no target code was executed.

Is this the best way to solve the issue?

The existing bridge, menu, overlay, and synchronous domain owners are appropriate for this migration, with a focused selection-priority correction required.

Full review comments:

  • [P2] Preserve the enabled selected choice when ArrowUp opens the picker — ui/src/components/select-picker-view.tsx:123-126
    With enabled choices Alpha, Beta, and Gamma and value Beta, ArrowUp on the closed trigger initializes Beta through the menu subscription, then this callback overwrites the highlight with Gamma. Enter consequently commits Gamma. The base prioritizes the enabled stored choice and uses the last row only as a fallback. Preserve that priority and cover ArrowUp reopening with an enabled current value. This repeats the unresolved prior finding; the latest commit leaves this production hunk unchanged.
    Confidence: 0.98

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

Provenance checked

  • Shared agent selection keeps the original intent (c780d8b: feat(ui): unify agent pickers with avatars #112488 unified avatar-aware controls while retaining caller-owned values and effects.)
  • Promise dialogs keeps the original intent (292b304: The shared promise-modal host owns settlement and cleanup; the migrated views retain that owner and pending-submit cancellation behavior.)
  • Toast lifecycle keeps the original intent (39ddf71: The shared toast provides Undo and dismissal outcomes; subsequent lifecycle work preserves paused deadlines and modal placement.)
  • Nested Lit and Solid mounting changes intended behavior with a stated reason (7c06f39: The retained boundary preserves owner context; this PR explains replacing nested top-level rendering with an owned root to avoid premature parent settlement.)
  • Appearance rendering keeps the original intent (c1258c0: Shared appearance controls retain their host tags, callback contract, glyph handling, and existing selection owner.)
  • Agent emoji selection keeps the original intent (0cf4182: The searchable emoji picker populates the existing identity draft rather than owning persistence.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/select-picker.behavior.browser.test.ts --project browser --maxWorkers=1
  • OPENCLAW_UI_WEBKIT=1 pnpm --dir ui test src/components/select-picker.behavior.browser.test.ts --project webkit --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9394889 adds ui/src/lib/toast.ts:137 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9394889ffad1; files: ui/src/lib/toast.ts)
  • Vyctor H. Brzezowski: Raw commit b977ccb adds ui/src/lib/toast.ts:26 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: b977ccb21e2b; files: ui/src/lib/toast.ts)

PR surface

PR surface statistics unavailable: the file list is incomplete.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The remaining defect changes keyboard selection in shared controls, with no evidence of an urgent production outage.
  • 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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-12T23:41:37.846Z sha 85e254d :: needs changes before merge. :: none
  • reviewed 2026-10-13T00:15:15.859Z sha 85e254d :: needs changes before merge. :: [P2] Route the new view imports through the existing Lit interop owner
  • reviewed 2026-10-13T00:34:06.269Z sha 85e254d :: needs changes before merge. :: [P2] Route the new view imports through the Lit interop owner | [P2] Migrate the remaining agent-picker test consumers | [P2] Preserve the command-palette trigger grid through the new wrapper
  • reviewed 2026-10-13T01:05:18.415Z sha feef905 :: needs changes before merge. :: [P2] Exclude the drawer itself from the nested Escape guard | [P2] Keep toast registration within the chat-send line-cap allowance
  • reviewed 2026-10-13T01:32:33.482Z sha f914f64 :: needs changes before merge. :: [P2] Keep toast registration within the chat-test line-cap allowance | [P2] Keep both shell files within their existing line caps
  • reviewed 2026-10-13T02:13:07.338Z sha 9ba774f :: needs maintainer review before merge. :: none
  • reviewed 2026-10-13T02:44:08.160Z sha 377495d :: needs changes before merge. :: [P2] Preserve the enabled selected choice when ArrowUp opens the picker | [P2] Wait for the lazy toast view in both archive outcome suites

Reviewed October 12, 2026, 11:27 PM ET / October 13, 2026, 03:27 UTC (Revision 8).

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 13, 2026
@steipete
steipete deleted the solid2/w-prim-c2 branch October 13, 2026 18:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with prior CI and scoped validation.

steipete added a commit that referenced this pull request Oct 13, 2026
ToastView became lazy in ecdc40d (#170387), so bridge updateComplete alone no longer settles the rendered notification. Match the owning toast test by joining dynamic imports and flushing Solid before the original assertions. Preserve currentness, authority, navigation and toast content expectations.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…nclaw#170387)

* refactor(ui): port shared pickers, dialogs, and toast to Solid

Preserve public tags, picker selection contracts, modal focus, and toast FIFO through the Solid bridge. Keep the existing lazy entry points and render notification content on first use.\n\nLocal migration checkpoint; integrate the approved native overlay prerequisite from main before publication.

* fix(ui): preserve picker layout and migrate language selection

* refactor(ui): reconcile picker migration with current shared helpers

* refactor(ui): preserve modal toast ownership during Solid migration

* fix(ui): preserve parent settlement during nested Solid mounts

* fix(ui): reveal the agent menu focus target

Follow the shared menu initial focus policy after its entry animation, including the enabled fallback when the stored selection is disabled. The long-menu regression is proven red before the change and passes in Chromium and WebKit.

* fix(ui): keep successive toasts visible in shadow root dialogs

Find the connected toast host through the existing modal-layer registry after reparenting moves it beyond document queries. Extend the existing shadow dialog regression with a second notice; preserve the service queue and dismissal owner.

* fix(ui): reconcile Solid picker and toast boundaries

* fix(ui): preserve selected agent focus during keyboard opening

* fix(ui): preserve keyboard ownership across picker boundaries

* fix(ui): keep agent identity loading on native picker events

* fix(ui): keep picker assertion rationale attached after formatting

* fix(ui): align picker imports and tests with current overlay contracts

* fix(ui): preserve drawer Escape ownership

* chore(ui): prune retired picker assertion allowances

* test(ui): yield recurring sidebar animation frames

Keep ordinary JSDOM frame settlement in microtasks, but route frames requested inside a frame callback through MessageChannel. This prevents the recurring overlay anchor from starving Bun workers while preserving owner-to-DOM settlement and controlled frame tests.

* test(ui): settle migrated picker and toast consumers

Keep sidebar ownership assertions on the native picker menu, await lazy Solid toast DOM for archive outcomes, and let roster bootstrap join the held dashboard query before the cold-load fixture rejects it. Preserve existing behavior and assertions.

* test(ui): trace native collaborator scroll policy

* fix(ui): preserve picker ArrowUp opening fallback

* refactor(ui): retain existing bridge type import

* fix(ui): remove picker registration from ambient types

* test(ui): drain mock responses during roster clock advances
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
ToastView became lazy in 5658968 (openclaw#170387), so bridge updateComplete alone no longer settles the rendered notification. Match the owning toast test by joining dynamic imports and flushing Solid before the original assertions. Preserve currentness, authority, navigation and toast content expectations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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