Skip to content

refactor(ui): schedule icon picker focus after settling - #174271

Merged
steipete merged 1 commit into
mainfrom
solid2/w-idiom-components-icon-focus
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-idiom-components-icon-focus

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What problem this solves

The session appearance picker stored a focus request in a signal solely to replay it through an effect after switching between the icon grid and custom input. The request was not presentation state.

Schedule the same focus work directly with Solid's onSettled from the existing event handlers. Keep the native click handlers, custom-input focus, Back-button focus and grid tab-stop restoration. No tag, selector, route, styling or domain-action changes.

Evidence

Check Result
Existing session-icon-picker tests 2 passed once: custom focus/IME/Back and keyboard tab stops/domain actions
UI types Passed
Targeted lint and formatting Passed after formatting correction
Production Knip Passed
Independent review Final full-context P2 review clean (confidence 0.91)
Broad proof Full CI run 38910969257 passed
Visual/startup Same DOM, styles and lazy boundary; no local build or screenshots for this behavior-only refactor

Touched production metrics against 88ef99e66fc9b698c2350774b5ef5dbef3c6c9a4:

Metric Before After
LOC 381 379
Controller-pattern refs 0 0
createEffect 1 0
createRenderEffect 0 0
untrack 0 0
Raw listeners 0 0
DOM queries 4 4
Hand-built classes 0 0

The retained queries implement the existing grid-wide roving tab stop. This change removes only the focus-request signal/effect; the grid's native keyboard behavior is unchanged.

Strict CI performance compared the merge base and head on the same runner: head startup 339,361 B gzip / 7 JS requests, and startup CSS 38,786 B / 1 request, unchanged CSS from base. Chat boot JS was 1,644,908 → 1,644,963 B (+55 B); new-session boot JS was 1,336,175 → 1,336,263 B (+88 B), with unchanged request counts and CSS. The check does not print a separate base initial-entry JS total. Startup remains below the 374,285 B baseline and all strict limits passed. No lazy-boundary or imported-library change.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@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.

@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-16T13:52:48.538060Z 96b6685 PR opened
ℹ️ 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.

@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 replaces the session icon picker’s focus-request signal and effect with event-triggered onSettled callbacks.

Example: Open Custom, enter 🦀, then select Back.

  • Before: An effect focuses the custom input and later restores focus and the tab stop to the Custom button.
  • After: Settled callbacks preserve the same focus and tab-stop behavior without a focus-request signal.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch matches the dependency contract and has no concrete finding; confidence in runtime behavior rests on reported component tests rather than shipped-entry-point evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; reported proof covers the production component in jsdom, with no shipped-browser focus demonstration supplied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No broken user behavior is claimed; the picker carries unnecessary reactive bookkeeping for imperative focus requests.
Reason: The existing area owner proposes a focused simplification that removes state and an effect while retaining the interaction contract.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it removes unnecessary reactive state using the supported Solid scheduling API, with no concrete introduced defect found.

Priority: P3
Reviewed head: 96b66855f6641520f39335d917cdcd2818c64cd1

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate Custom, Back, Escape, and restored keyboard focus through the shipped Control UI in Chromium and WebKit.
Agent review details

How this fits together

The Control UI session appearance picker receives menu events and session presentation data, updates local input mode and focus, and forwards appearance actions to the existing session action owner.

flowchart LR
  A[Session menu] --> B[Appearance picker events]
  B --> C[Local mode and draft]
  C --> D[Solid DOM update]
  B --> E[Settled focus callback]
  D --> E
  B --> F[Session action owner]
Loading

Technical review

Best possible solution:

Keep focus scheduling in the existing appearance owner using onSettled while preserving native events, keyboard navigation, and session action dispatch.

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

This is a behavior-preserving refactor rather than a reported bug; existing component scenarios exercise the affected focus paths, and no target code was run during this review.

Is this the best way to solve the issue?

The change uses the pinned Solid API for event-triggered post-settle work and completely removes the superseded signal/effect path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Session appearance focus scheduling keeps the original intent (4818138: The shared session Solid migration preserved custom-input and grid focus behavior; the later native-menu migration retained that contract.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced patch removes the focus-request signal and effect, retains both focus targets and grid tab-stop restoration, and changes no action dispatch. (ui/src/components/session-icon-picker-solid.tsx:308, 96b66855f664)
  • Pinned dependency contract: The changed module imports onSettled from solid-js 2.0.0-rc.14; that package’s published cheatsheet explicitly supports event-handler callbacks after the triggered transition settles, and its runtime delegates onSettled to the signals scheduler. (packages/solid/CHEATSHEET.md, 8d23a5a13b23)
  • Existing behavioral coverage: The unchanged component tests cover custom-input focus, IME Enter handling, Back focus restoration, keyboard tab stops, and appearance actions; the PR reports both tests passed. (ui/src/components/session-icon-picker.test.tsx:7, 96b66855f664)
  • Current main and feature history: Fetched main retains the signal/effect implementation. The Solid migration and subsequent native-menu and presentation refactors establish steipete as the current feature-history owner; their stated contract preserves focus and domain ownership. (ui/src/components/session-icon-picker-solid.tsx:308, 01e659317b7f)
  • Discussion and validation state: The complete current body and comments supply component-test and static-check results but no shipped-browser demonstration; exact-head CI remains pending, with no observed failing product check. (96b66855f664)
  • Policy and history limits: Root and UI AGENTS.md and applicable Solid guidance were applied; no deeper ancestor policy or maintainer-notes directory exists. Older pre-Solid history searches encountered unavailable blobs, while the responsible Solid implementation and subsequent history were readable. (ui/AGENTS.md, 96b66855f664)

PR surface

Source -2. Total -2 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 16 18 -2
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 1 16 18 -2

Labels

Label changes:

  • add P3: This is a small internal UI simplification 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 a small internal UI simplification 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, 10:05 AM ET / 14:05 UTC.

@steipete
steipete merged commit a60b6a7 into main Oct 16, 2026
106 of 107 checks passed
@steipete
steipete deleted the solid2/w-idiom-components-icon-focus branch October 16, 2026 14:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: XS 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