Skip to content

refactor(ui): derive tab selection and focus in Solid - #174254

Merged
steipete merged 1 commit into
mainfrom
solid2/w-idiom2-lib-effects-next
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-idiom2-lib-effects-next

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Tabs had two selection writers: Solid rendered ARIA and tab order, then an imperative controller queried and rewrote the same buttons. Replace that controller in both the shared primitive and panel strip with one owner-scoped Solid helper. Selection and roving focus derive from current items; JSX owns attributes and handlers, and keyed refs own keyboard focus targets and cleanup.

Preserves controlled rejection, uncontrolled defaults, explicit null selection, manual/automatic activation, disabled tabs, RTL/vertical navigation, activation vetoes, keyed movement, and detached-node teardown. Styles and geometry remain external synchronization. No visual design, CSS, tag, selector, route, dependency, or lazy-boundary changes. The boot-module manifest was regenerated through its owner; it also drops stale entries from previously landed migrations.

Evidence

Proof Result
UI typecheck Pass
Tabs, panel strip, HubTabs 15 cases pass; cleanup-specific rerun passes without strict-read diagnostics
Targeted lint Plugin-SDK declaration preparation timed out; CI owns remaining lint proof
Production Knip Pass
Independent autoreview No actionable P0–P2 findings
Same-machine base/head builds and strict performance Pass against d8faf88
Head startup 339,364 B gzip, 7 JS requests, 1 CSS request (38,786 B gzip)
Chat boot JS 1,645,163 → 1,644,919 B gzip; 31 requests unchanged
New Session boot JS 1,336,298 → 1,336,158 B gzip; 27 requests unchanged

The remaining effects synchronize shadow styles and measured/focused DOM. The two new untracked reads snapshot stable keyed identities; they do not freeze changing item data. Browser layout, retention, and full UI integration proof run in PR CI with ci:full; no local E2E or parity batteries were run. This is a behavior-preserving state refactor, so proof uses DOM selection/focus contracts rather than visual redesign captures.

Touched production-file metrics (including removed and replacement helper):

Metric Before After
LOC 720 701
Controller-pattern refs 0 0
createEffect 3 3
createRenderEffect 0 0
untrack 2 3
addEventListener 2 0
DOM queries (including generic type arguments) 7 6
Hand-built class strings 0 0
flush 1 1
getOwner/runWithOwner 0 0

Production LOC falls by 19; the existing test file grows by 42 lines for the local-selection/default-reset boundary. The imperative DOM-controller implementation and its registration/teardown wiring are gone. No release-note behavior change.

CI attribution: full run 38909177146 completed with 65 terminal jobs. All selected jobs passed except the two real-Gateway shards and their downstream gate. The exact two failing tests pass in scheduled main run 38908699969; this is source-unrelated attribution, not a matching-main-failure claim.

  • Control UI command palette search with a real Gateway > finds a grouped spawned conversation beyond the roster and treats a full result page as success fails during readiness, before the shell or tabs render. All seven Gateway handshakes return UNAVAILABLE; the Gateway/client/fixture sources are unchanged.
  • Control UI real Gateway reconnect continuity > reconstructs one streamed turn after browser socket loss, then aborts and follows up cleanly matches two reply paragraphs after the provider finishes but before the generating control detaches. The transcript/history/Gateway sources are unchanged; tabs has no write path to those states and this plain-text scenario does not use the tool-card tab selector. The precise duplicate-node cause is unknown.

Native admin evidence binds the actual tested merge 532f0b7ed3103b77b7db3a6d36233910dde77605, its ordered main/head parents, unchanged source trees, exact job logs, full job accounting and passing security-fast. Landing uses the coordinator-authorized source-unrelated exception.

@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
@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:41:17.325787Z 6f355e8 Draft marked ready
ℹ️ 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 marked this pull request as draft October 16, 2026 13:36
@steipete
steipete marked this pull request as ready for review October 16, 2026 13:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f355e8f7d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return (
<button
{...item().attributes}
ref={ref}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Compose the caller ref with the tab-list ref

Because the new ref={ref} follows {...item().attributes}, it replaces rather than composes any caller-supplied ref. The Worktrees tab supplies attributes.ref to initialize worktreesTab, which is then passed to reclaimHubTabFocus; after keyboard navigation from Sessions to Worktrees, that variable remains unset and the destination page cannot restore focus. Compose the internal and caller refs so both receive the button.

AGENTS.md reference: ui/AGENTS.md:L5-L7

Useful? React with 👍 / 👎.

@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 imperative tab selection and focus controllers with one shared Solid helper.

Example: In a manually activated tab list, press ArrowRight from Alpha to Beta, then Enter.

  • Before: The imperative controller updates roving focus and selection attributes.
  • After: The shared Solid helper derives focus and selection, and JSX renders the attributes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused refactor appears correct and removes duplicate ownership; supplied behavioral evidence is limited to component harnesses.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the contributor proof gate; the body supplies component-test and build results, but no linked recording, logs, or live output exercising the changed tab behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The feature owner's direction is already approved through authorship, and consolidating competing DOM selection writers reduces maintenance cost without adding configuration or capability.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored refactor open: it consolidates tab ownership, and source review found no actionable introduced bug.

Priority: P3
Reviewed head: 6f355e8f7d9108482f455449213087ba0ddf7d19

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show the changed selection and focus paths running through the shipped UI; the added test is preservation coverage, with no base-failing regression demonstration.
Agent review details

How this fits together

The shared Tabs primitive and panel strip consume caller-owned items and selection, then produce accessible buttons, selection callbacks, keyboard navigation, and focus effects.

flowchart LR
  A[Caller items and selection] --> B[Shared tab helper]
  B --> C[Solid tab buttons]
  C --> D[Pointer and keyboard events]
  D --> B
  B --> E[Caller selection callback]
  B --> F[Keyed DOM focus targets]
Loading

Technical review

Best possible solution:

Retain the single Solid tab owner and complete the existing required UI checks before landing.

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

This is a behavior-preserving refactor; source tracing disproves the existing ref-overwrite report, and no target code was executed during this read-only review.

Is this the best way to solve the issue?

The approach fits the repository's Solid ownership guidance by deriving presentation state and deleting the superseded controller across both consumers.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Tab selection, keyboard navigation, and focus ownership keeps the original intent (b68c44c: The native Solid primitives migration preserved existing callers, keyboard behavior, focus, cancellation, and appearance.)
  • Shared tab options and imperative synchronization changes intended behavior with a stated reason (9afcbdf: The preceding refactor removed copied reactive options while retaining the synchronous focus owner; this PR explicitly replaces that remaining controller with derived presentation state.)
  • Generated boot-module inventory keeps the original intent (2077fb5: Measured boot groups separate shared, New Session, and Chat startup work; the reported regeneration updates module membership without changing grouping policy.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and complete cutover: The pinned introduction replaces both controller callers, removes tabs-controller.ts, and adds the owner-scoped helper; current main still uses the imperative controller. (ui/src/lib/tabs.ts:22, 6f355e8f7d91)
  • Existing ref finding is disproved by the pinned dependency: The changed components import Solid, and ui/package.json pins its compiler and runtime to rc.14, establishing the dependency contract. At the package's verified gitHead, spread.rs excludes explicit ref attributes from merged spread properties and handles them separately; the published web runtime also invokes newProps.ref. Therefore the caller's spread ref is not overwritten by ref={ref}, contrary to the concern in refactor(ui): derive tab selection and focus in Solid #174254 (comment). (packages/compiler/src/dom/spread.rs:65, 8d23a5a13b23)
  • Worktrees focus caller traced: Worktrees supplies attributes.ref to capture its destination tab, then passes that node to reclaimHubTabFocus; this path remains supported by the pinned compiler's separate ref handling. (ui/src/pages/worktrees/worktrees-page.tsx:128, 6f355e8f7d91)
  • Behavioral coverage: The added component test asserts manual focus, direct activation, retained selection across reorder, explicit null reset, automatic activation, and disabled-tab exclusion; existing tests cover controlled rejection and detached-node teardown. (ui/src/components/solid/tabs.test.tsx:66, 6f355e8f7d91)
  • Feature history and original intent: History identifies Peter Steinberger as the dominant current feature owner across native tab introduction, panel migration, and subsequent derivation refactors. feat(ui): use native Solid overlays and tabs #169128 established preserved keyboard, focus, caller, and appearance contracts; refactor(ui): derive shared tab options #174158 retained synchronous focus ownership during the preceding options refactor. (ui/src/components/solid/tabs.tsx:26, c5aabc24a6ed)
  • Required CI remains pending: The reviewed head's aggregate CI status remains pending, with UI E2E jobs still running; cancelled checks do not establish a diff-caused failure. (6f355e8f7d91)

Likely related people:

  • Peter Steinberger: Raw commit b68c44c adds ui/src/components/solid/tabs.tsx:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b68c44ca8f3c; files: ui/src/components/solid/tabs.tsx)

PR surface

Source -39, Tests +42. Total +3 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 221 260 -39
Tests 1 42 0 +42
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 263 260 +3

Review metrics

Metric Value Why it matters
Production versus test LOC Production −19 LOC; tests +42 LOC The replacement removes controller wiring while adding meaningful coverage of local selection and default reset.

Labels

Label changes:

  • add P3: This is an internal ownership refactor with intended behavior preservation and no demonstrated urgent user 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 an internal ownership refactor with intended behavior preservation and no demonstrated urgent user 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, 9:51 AM ET / 13:51 UTC.

@steipete
steipete merged commit 9e7af99 into main Oct 16, 2026
190 of 232 checks passed
@steipete
steipete deleted the solid2/w-idiom2-lib-effects-next branch October 16, 2026 14:13
@steipete

Copy link
Copy Markdown
Contributor Author

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

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