Skip to content

refactor(ui): derive shared tab options - #174158

Merged
steipete merged 1 commit into
mainfrom
solid2/w-idiom-core-tabs
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-idiom-core-tabs

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The shared tab primitive copies reactive options into a mutable local object during effect application. Deriving those options with a memo removes that second representation while retaining the existing synchronous focus owner.

User Impact

Selection, rejection, keyboard behavior, keyed node identity, classes, and cleanup are unchanged. No markup or styles change.

Why This Change Was Made

The focus owner reads the current memo through an explicitly untracked sampling callback; the effect owns dependency tracking and synchronizes DOM and shadow styles. This keeps imperative reads out of Solid tracking without copying options into state.

Evidence

Proof Result
UI typecheck Passed
Existing tab behavior test Passed; final run 4.11 s (7.12 s wrapper wall time)
Independent review No actionable P0–P2 findings
Scoped lint / production Knip Passed; Knip 6m 4.6s
Before / after UI build and strict performance Passed on the same machine
CI Full UI selection requested with ci:full

The first local test exposed a development warning at the imperative memo read. The explicit snapshot boundary fixes it; the final targeted run has no Solid read warnings. No assertion changes or extra test scaffolding.

Metrics for ui/src/components/solid/tabs.tsx against ab81577da1d128c428ec66553f8380802c7e114a:

Metric Before After
Production LOC 136 133
Controller-pattern lines 0 0
createEffect 1 1
createRenderEffect 0 0
createMemo 0 1
untrack 0 1
Native listeners / DOM queries / class strings / flush / owner captures 0 0
Mutable options copies 1 0

The new untrack is the documented imperative sampling boundary, not a frozen value: each DOM operation reads the current options. The remaining effect updates an external DOM owner. Test LOC is unchanged. No visual capture because DOM, classes, and styles are unchanged.

Startup JavaScript: 339,753 → 339,746 B gzip (-7 B); 7 requests. CSS: 38,786 B, 1 request. Both strict checks passed, with no new dependency or lazy-boundary change.

Full CI attribution

Run 38893007970 passed all executed jobs except UI E2E 6/9 and its aggregate gate. The five failures are:

  • Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 1440px
  • Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 1100px
  • Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 768px
  • Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 640px
  • Models settings layout and discovery > Models page keeps controls separate and publishes discovery into a passive picker at 390px

Each expected six settings rows but received the additional Utility Fallback Model row introduced on main by #173906. Actual CI merge 452f2e0124efea29364572b19edc7a170849355a has ordered parents 3d6fc699ad082cb41fde231706168944b53aa745 and this PR head. The test, default-model renderer, SettingsRow primitive, and English catalog have identical Git objects between that main parent and the tested merge; only the tab primitive differs. This is an unrelated stale expectation, not a claimed matching-signature main failure. Latest scheduled main run 38894297213 was queued when checked; the older scheduled run passed this shard.

The native documented admin route is authorized for this attributed failure. No failed CI result is reported as green.

@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-16T11:21:52.164279Z d2d3fcf 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 derives shared tab options with a memo instead of copying them into mutable state.

Example: Select Beta while Alpha is active and the selection callback rejects the change.

  • Before: Alpha remains selected.
  • After: Alpha remains selected, with controller options read from the memo.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused and apparently correct simplification, supported by existing behavioral coverage; direct runtime evidence remains limited.
Proof confidence 🦐 gold shrimp (3/6) Under the supplied maintainer-authored classification, the ordinary contributor proof gate does not apply; supplied validation covers the existing tab test and build checks, without a direct shipped-browser interaction trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The recorded maintainer-directed change removes a redundant representation without expanding scope, changing defaults, or replacing the synchronous focus owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused, maintainer-directed refactor has no actionable findings; the failed CI gate comes from a separately confirmed Models layout failure.

Priority: P3
Reviewed head: d2d3fcfffd551a6807bf1bb5c82a84fb2479a40e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-browser trace directly demonstrates tab selection and keyboard behavior after the refactor; the ordinary contributor proof gate is inapplicable under the supplied maintainer-authored classification.
Agent review details

How this fits together

The shared Control UI tab primitive receives reactive selection and item props, renders keyed buttons, and supplies current options to the synchronous keyboard and focus controller.

flowchart TD
  A[Page props] --> B[Options memo]
  A --> C[Keyed tab buttons]
  B --> D[DOM synchronization effect]
  B --> E[Untracked controller reads]
  C --> E
  D --> F[Focus and stylesheet updates]
  E --> F
Loading

Technical review

Best possible solution:

Retain the memo derivation and existing synchronous controller, then land through the native workflow once the unrelated CI failure is dispositioned.

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

This is an internal refactor rather than a reported defect; source inspection confirms the mutable options copy it removes, and no target code was executed.

Is this the best way to solve the issue?

The change follows the repository's derive-instead-of-copy guidance while preserving the existing imperative owner and its synchronization effect.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared tab options and imperative synchronization keeps the original intent (b68c44c: The native Solid migration preserved existing tab callers, keyboard behavior, focus, and appearance through a shared controller.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b68c44c adds ui/src/components/solid/tabs.tsx:27 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 -3. Total -3 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 29 32 -3
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 29 32 -3

Labels

Label changes:

  • add P3: Internal UI simplification with unchanged intended user behavior and no identified regression.
  • 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: Internal UI simplification with unchanged intended user behavior and no identified regression.
  • 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, 7:38 AM ET / 11:38 UTC.

@steipete
steipete merged commit 9afcbdf into main Oct 16, 2026
112 of 116 checks passed
@steipete
steipete deleted the solid2/w-idiom-core-tabs branch October 16, 2026 11:48
@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: 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