Repository navigation
refactor(ui): derive tab focus with a native store - #179359
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces the shared tab helper’s object signal with a writable derived Solid store. Example: Tab A is selected in manual activation mode, and ArrowRight moves focus to tab B.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: the focused refactor preserves the existing focus contract, and no actionable correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI’s shared tab helper consumes selected and enabled tab values plus keyboard and click events, then supplies tab order, selection callbacks, and DOM focus to shared tabs and panel strips. flowchart LR
A[Tab props and items] --> B[Shared tab helper]
C[Keyboard and click events] --> B
B --> D[Derived focus store]
D --> E[Tabindex bindings]
B --> F[Selection callbacks and DOM focus]
Technical reviewBest possible solution: Retain the existing tab owner and focus-reset policy while using Solid’s native derived store for the structured local state. Do we have a high-confidence way to reproduce the issue? No broken user behavior is claimed; this is a behavior-preserving refactor, and no target code was executed during this read-only review. Is this the best way to solve the issue? The diff is a small, complete representation change within the existing owner: it preserves selection and enabled-item dependencies, removes the replaced signal path, and needs no additional abstraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ba1f3b252959. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4. Total +4 across 1 file. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 6:33 AM ET / 10:33 UTC. |
|
Merged via squash.
|
Whole-scope Solid 2 census, base
93a248d1f9db→ this head. Counts are before → after; unchanged values appear once. “Candidates” means local presentation work, excluding synchronous domain-owner APIs and deliberate foreign-DOM adapters.Whole-scope production LOC: 91,604 → 91,608 across 566 files. This PR changes only
ui/src/lib/tabs.ts(224 → 228 lines). The base includes the merged plugin presentation cleanup and a plain channel-owner refactor. This PR removes the tab-focus object signal; recovery dialogs and app ownership remain separate PRs.What Problem This Solves
Tab keyboard focus kept
{ active, value }in an object signal and replaced the object for every navigation event. Use a writable derived Solid 2 store with draft setters, preserving manual focus until the selected tab changes or the focused tab disappears.User Impact
Behavior is unchanged: automatic/manual activation, disabled-tab skipping, direction-aware arrow keys, Home/End, and focus recovery retain their existing contracts. No markup, styles, routes, tags, or selectors change.
Evidence
pnpm tsgo:ui(tsrs)--maxWorkers=1git diff --checkpnpm ui:buildBase and head exceed the existing absolute startup and Chat caps; growth is below the campaign's 64 B maximum for an over-budget surface. Neither cap nor baseline is changed. The complete strict JSON comparison is retained. No local E2E or parity runs were used. CI uses
ci:fullbecause this helper serves shared tab/focus consumers.Production LOC: 224 → 228 (+4); test LOC unchanged. The explicit store seed and draft mutations account for the four lines. The immutable object replacement path is removed. Existing tests independently cover focus, selection, removal, activation and close recovery. This is a state representation refactor without a visual change.
Remaining scope and permitted exceptions
async-and-actions.mdis absent on fetched main; refactor(ui): add Solid async recipes and cron reference #179123 remains in flight. Remaining app focus loading, MCP catalog discovery, board browser inspection, and plugin history have cancellation/scope ownership that must survive their later presentation migration. Local update confirmation, board browser commands and plugin contributions are the mutation candidates.createComponentcalls in the generic foreign-DOM bridge and foreign-island owner APIs remain adapter responsibilities. Optional contexts preserve their absent-provider contract; no throw-only wrappers remain.onCleanupin this file belongs to ref registration within a primitive, not component teardown. No demonstrated sibling Loading group needs Reveal.Refreshed-head validation
The branch now merges main at
93a248d1f9db; the one-file patch is unchanged. Previous UI/Gateway failure attribution is withdrawn: those exact cases pass the latest completed scheduled main run 39592709539. The refreshed head will use fresh full CI. Refreshed typecheck and both same-machine builds passed. The table above now contains the refreshed measurements: +1 B startup, +12 B Chat, +2 B New Session, with unchanged CSS. Final-head production Knip passed. Full CI run 39598311154 is running onc883b0d500bacd7ca5fa29cac3ea8322ff099d31.