Skip to content

refactor(ui): own appearance picker focus with element refs - #174481

Merged
steipete merged 2 commits into
mainfrom
solid2/w-idiom-components-appearance-focus
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-idiom-components-appearance-focus

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Appearance controls carry duplicate caller-side focus and DOM lookup code after the Solid migration.

User Impact

No user-visible change. Custom icon entry, returning to the icon grid, keyboard navigation, and IME handling keep their existing behavior.

Why This Change Was Made

The shared appearance picker now owns refs to its input and rendered choices. Its two consumers request focus after rendering settles, instead of querying their host or publishing a focus signal. Session-menu roving tab stops remain specific to the menu; the standalone picker keeps its focus behavior. The obsolete host parameters disappear with that wiring. No tags, classes, routes, styles, or lazy boundaries change.

Evidence

Proof Result
Menu behavior 2/2 existing tests pass, including focus, roving tab stop, actions, and IME
Chromium appearance picker 4/4 pass; custom input and return focus asserted; Enter never submits the enclosing form
UI typecheck Pass
Scoped lint/format Pass after fixing two lint findings; the initial SDK declaration timeout did not reproduce on the exact base
Production Knip Pass, no new ignores
Independent P0–P2 review Scoped clean: initial refactor 0.85; lint repair 0.98
Same-machine exact-base/head builds and strict performance Pass on both sides
Startup JS gzip 339,710 → 339,717 B; 7 requests on both; raw bytes identical at 1,034,166 B
Startup CSS gzip 38,786 B / 1 request, unchanged

The startup difference is filename/compression variance; the refactor stays in the existing lazy dependency graph. This is a nonvisual ownership change with unchanged markup and styles; direct focus/keyboard boundary tests provide the behavior proof. PR CI with ci:full supplies broad UI coverage.

Touched production metrics Before After
LOC 1,824 1,822
Controller references 0 0
createEffect 1 0
createRenderEffect / untrack 0 / 0 0 / 0
Native listeners 3 3
DOM queries, including generic typed calls 5 0
Class construction / flush / owner captures 1 / 0 / 3 1 / 0 / 3

Touched test LOC: 153 → 161. The checklist’s literal querySelector(All)?\( pattern misses the five generic typed calls removed here; its literal count is 0 → 0.

CI attribution

Exact-head ci:full run 38940785837 completed with 35 passing jobs, 26 skipped jobs, and two E2E failures plus the aggregate gate. Both failing test names and assertions match the latest completed scheduled main run38940084041:

  • Link hover previews > keeps title hints when the optional hover runtime cannot load: line238 times out waiting for the Field guide link.
  • Claude native session catalog > auto-loads older chat without moving the viewport and disables paired-node continuation: line567 expects at least3 catalog requests but sees2.

The tests and fixture blobs are unchanged in the verified CI merge. The native inherited-failure route retains these failed results; no CI success is claimed.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@steipete
steipete marked this pull request as ready for review October 16, 2026 17:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T17:37:46.258501Z 1c65fd1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) October 16, 2026 17:41
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves appearance-picker focus handling into the shared component and removes obsolete caller host arguments.

Example: Enter 🦉 through Custom emoji in a board appearance picker.

  • Before: The caller finds DOM elements to focus the input and return to Custom emoji after applying.
  • After: The shared picker focuses its element refs after rendering settles, preserving the same interaction.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, coherent refactor with useful component-boundary coverage and no identified defect; supplied behavior evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; reported browser and jsdom runs cover custom-input focus, return focus, keyboard navigation, and IME behavior through production components.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-directed change removes duplicate focus ownership and obsolete arguments while preserving existing interactions and public component contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor consolidates focus ownership without an actionable correctness or security finding.

Priority: P3
Reviewed head: 1c65fd1096442c4a57aff26e945b8edb21f1e06c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped Control UI focus walkthrough is supplied; inspected behavioral coverage uses browser and jsdom component harnesses.
Agent review details

How this fits together

The Control UI's shared appearance picker receives appearance values and callbacks from standalone controls and session menus, renders choices, manages keyboard focus, and forwards selections to existing action owners.

flowchart TD
  A[Standalone appearance control] --> C[Shared appearance picker]
  B[Session menu consumers] --> C
  C --> D[Element refs and settled focus]
  C --> E[Existing selection callbacks]
  E --> F[Appearance action owners]
Loading

Technical review

Best possible solution:

Keep one ref-based focus owner in the shared picker while preserving each consumer's existing tab-stop behavior.

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

This is a behavior-preserving refactor rather than a reported bug; source inspection confirms the duplicate focus plumbing, and no runtime reproduction was attempted.

Is this the best way to solve the issue?

The shared picker already owns the rendered controls, making it the appropriate focus owner; the diff preserves native event handling and removes the replaced caller paths.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff replaces caller DOM queries and a focus signal with a shared focus handle; both session-menu callers drop the obsolete host argument. (ui/src/components/session-icon-picker-solid.tsx:42, 1c65fd109644)
  • Keyboard and focus contracts: Choice refs are filtered for connected, enabled buttons and sorted into DOM order; existing arrow navigation, IME handling, and menu-only roving restoration remain. (ui/src/components/session-icon-picker-solid.tsx:141, 1c65fd109644)
  • Current main still has caller focus plumbing: The relevant production files match the merge-base implementation on fetched main, which retains caller queries and the standalone focus signal. (ui/src/components/appearance-picker.tsx:29, 7d636d93b8d4)
  • Behavioral coverage: Existing browser and jsdom scenarios gain assertions for custom-input focus, return focus, and the menu's sole grid tab stop; assertions exercise rendered production components rather than focus-helper internals. (ui/src/components/appearance-picker.browser.test.ts:29, 1c65fd109644)
  • Discussion and merge state: The full live body and comments contain component-test and build results, with no shipped focus walkthrough. GitHub reports the reviewed head mergeable with merge state blocked; exact-head UI unit, production-type, lint, and performance checks pass while some UI E2E jobs remain in progress. (1c65fd109644)
  • Policy and inspection limits: Read the complete root and UI instructions and applicable Solid review guidance; UI has no deeper AGENTS.md and the maintainer-notes directory is absent. The installed Solid cheatsheet is unavailable, and older follow-history encounters unavailable objects; relevant pinned blobs and migration history were readable. No target code or second reviewer was run, and the checkout remains clean. (ui/AGENTS.md:5, 1c65fd109644)

PR surface

Source -2, Tests +8. Total +6 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 70 72 -2
Tests 2 10 2 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 80 74 +6

Review metrics

Metric Value Why it matters
Production versus test LOC Production −2; tests +8 The ownership consolidation slightly reduces production code and adds focused observable focus assertions.

Labels

Label changes:

  • add P3: This is internal UI maintenance with no intended user-visible behavior change or established urgent defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal UI maintenance with no intended user-visible behavior change or established urgent defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 October 16, 2026, 1:50 PM ET / 17:50 UTC.

@steipete
steipete disabled auto-merge October 16, 2026 18:11
@steipete
steipete merged commit c4540c1 into main Oct 16, 2026
105 of 110 checks passed
@steipete
steipete deleted the solid2/w-idiom-components-appearance-focus branch October 16, 2026 20:37
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…#174481)

* refactor(ui): own appearance picker focus with element refs

* style(ui): satisfy appearance picker lint rules
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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