Skip to content

refactor(ui): derive tab focus with a native store - #179359

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-tabs
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-tabs

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

File family 1 unsafe/native bindings 2 component/all cleanup 3 manual read pipelines 4 local mutation flows 5 manual view loaders/runtime imports 6 copied presentation objects 7 manual component factories 8 throw-only contexts 9 sibling loading groups 10 non-island/all owner APIs
app (190 files) 0/30 0/3 1 1 0/67 3: focus plus two recovery dialogs 0 0 0 6/6
lib, excluding reactive (345 files) 0/10 0/5 2 1 controller, 3 commands 0/10 1 → 0 tab-focus slots 3 foreign-DOM adapter calls 0 0 0/4
plugin presentations (5 files) 0 0/2 1 1 raw + 1 native action 0/1 1 0 0 0 0
plugin SDK/DOM bridges (5 files) 0 0 / 1 2 foreign mounts, exempt 3 delegated SDK commands, exempt 0/8 1 opaque props slot, exempt 0 0 0 0/7
plain plugin owners (9 files) 0 0 0 presentation wrappers 0 presentation wrappers 0/4 0 0 0 0 0
plain API owners (12 files) 0 0 0 presentation wrappers 0 presentation wrappers 0/2 0 0 0 0 0

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

Proof Result
pnpm tsgo:ui (tsrs) Pass
Three directly relevant suites via pinned Bun and --maxWorkers=1 26 tests pass
Scoped lint, formatting, git diff --check Pass
Production Knip Pass on refreshed final head
Independent Codex P0–P2 review Scoped-clean; no actionable findings
Base/head pnpm ui:build Pass
Strict startup JS gzip 331,314 → 331,315 B (+1 B)
Strict Chat boot JS gzip 1,500,965 → 1,500,977 B (+12 B)
New Session boot JS gzip 1,018,351 → 1,018,353 B (+2 B; under cap)
Startup CSS 1 request; 40,439 B unchanged

Base 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:full because 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
  • Items 3–4 await the canonical recipes: async-and-actions.md is 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.
  • The plugin dashboard object and component teardown landed in refactor(ui): use native plugin presentation state and lifecycle #179352. App owner-lifetime cleanup is being proved separately; its detached post-settle scheduler still requires explicit lifetime preservation.
  • Three createComponent calls 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.
  • Existing onCleanup in 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 on c883b0d500bacd7ca5fa29cac3ea8322ff099d31.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 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 21, 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-21T12:25:40.468592Z c883b0d 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: B receives focus and tabindex 0 while A remains selected.
  • After: The same behavior uses store draft mutations instead of replacing the focus object.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent with the existing contracts; evidence is strongest at the automated contract level, and both red root CI cases independently occur on main.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored representation refactor is outside the ordinary contributor-proof gate; focused test results support the change, while the inspected automation screenshots do not establish keyboard-focus behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The feature-history owner has selected this native Solid representation, and the patch stays within that direction without changing supported behavior or adding public options.

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
Reviewed head: c556abf6aa43268ddb566827d708ef6043ee0e07

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied screenshots do not demonstrate manual keyboard focus surviving reorder and recovering after focused-tab removal through the shipped Control UI.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Shared tab focus derivation and event writes keeps the original intent (9e7af99: Use one owner-scoped Solid helper for selection and roving focus, retaining manual focus until selection changes or the focused tab disappears; the later controlled-horizontal narrowing remains intact.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9e7af99 adds ui/src/lib/tabs.ts:34 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9e7af995ddf2; files: ui/src/lib/tabs.ts)

PR surface

Source +4. Total +4 across 1 file. Added test files: 0.

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

Review metrics

Metric Value Why it matters
Production versus test LOC Production +4 net lines; tests unchanged The explicit store seed and draft setters replace the object-signal path without adding another owner or test scaffolding.

Labels

Label changes:

  • add P3: This is an internal state-representation cleanup with no intended user-visible behavior change.
  • 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 state-representation cleanup with no intended user-visible behavior change.
  • 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 21, 2026, 6:33 AM ET / 10:33 UTC.

@steipete
steipete merged commit 4b421fd into main Oct 21, 2026
104 of 106 checks passed
@steipete
steipete deleted the solid2/w-s2-tabs branch October 21, 2026 13:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
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