Skip to content

refactor(ui): share native settings select rendering - #182796

Merged
steipete merged 2 commits into
mainfrom
solid2/w-ui-arch-census
Oct 24, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-ui-arch-census

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Twelve native settings selects repeat option rendering and selected-value bindings across settings, devices, Cron, Activity, and the skill library.

User Impact

Behavior and appearance stay the same. The shared renderer keeps the existing native select, classes, attributes, disabled options, and change handlers, including rejected-target rollback. Media-permission and language-reset selectors retain their specialized implementations.

Why This Change Was Made

One small SettingsSelect now owns the repeated option loop. Callers still own validation, mutations, and option labels. All existing lazy boundaries remain intact. Touched production files shrink from 4,202 to 4,164 lines (38 fewer); the new behavioral test adds 48 lines.

This is the first proof from the UI architecture census. The broad inventory contains about 531k production TypeScript lines after excluding tests, translation catalogs, and generated validators; existing menu, dialog, form, and loading primitives already absorb most obvious duplication.

Evidence

Same-machine production builds at base 820c30a3a010 and this change:

Surface Before After Change
Startup JS gzip 281,092 B 281,132 B +40 B, inside 64 B build variance
Startup requests 7 JS + 1 CSS 7 JS + 1 CSS unchanged
Chat boot JS gzip 1,274,625 B 1,274,289 B −336 B
New Session boot JS gzip 770,842 B 770,731 B −111 B
All emitted JS gzip 12,929,446 B 12,928,958 B −488 B
All emitted CSS gzip 303,639 B 303,639 B unchanged

pnpm tsgo:ui passes. The focused select test passes, covering controlled selection, label/disabled updates, retained option nodes, and replacement handlers. Targeted lint has no errors (one unchanged Activity reactivity warning). Independent Codex autoreview found no actionable P0–P2 issues.

pnpm ui:build passes on both sides. The strict performance checker reports the same pre-existing total CSS overage on both: 303,639 B gzip vs 303,372 B cap, and 1,596,159 B raw vs 1,595,521 B cap. This change adds no CSS. Production Knip reports three unused files outside the UI diff: extensions/codex/src/app-server/protocol-validator-schemas.ts, src/gateway/mcp-app-standalone-host.ts, and src/gateway/worker-environments/repository-node-requirement.ts.

Inspected synthetic production screenshots at 1440 px and 390 px are attached below. Desktop content crops and full mobile captures have identical SHA-256 hashes before/after. The desktop crop excludes the unrelated build dirty marker. Capture uses the native Vitest/Playwright screenshot helper with fixed fixture time; Node is used only for that Playwright harness. Broad behavior proof runs in PR CI with ci:full.

An exploratory reordered-option test also failed in the original renderer; that inherited native selection-ordering issue is outside this behavior-preserving consolidation.

Before desktop

After desktop

Before mobile

After mobile

Initial CI found two PR-caused verification issues: the fixed option fixture needed safe typing under the test leaf, and moving the literal SKILL.md label changed its raw-copy classification. The repair preserves the test assertions and regenerates the existing inventory entry; the component test, exact UI-components test-type leaf, i18n verification, format check, and fresh repair review all pass. Production code and the measured bundles/screenshots are unchanged. The initial auto request was retired before pushing this repair; the new exact head will use native replacement recovery.

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

clawsweeper Bot commented Oct 24, 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 24, 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-24T19:30:48.490359Z 11519f4 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.

@steipete
steipete enabled auto-merge (squash) October 24, 2026 19:19
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR shares native select rendering across settings, devices, Cron, Activity, and the skill library.

Example: Appearance settings display the send shortcut as Enter.

  • Before: The settings row renders its own native select and option loop.
  • After: The shared SettingsSelect renders the same Enter selection and forwards changes to the existing callback.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, compact refactor with inspected rendering parity and focused behavioral coverage, held back by a definite baseline mismatch and incomplete attribution of other CI failures.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor-proof gate is not applicable under the supplied maintainer-authored classification; inspected synthetic production screenshots show unchanged appearance-settings rendering at desktop and mobile widths, supported by a focused native-control test.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes
User problem: Repeated native-select implementations can drift in selection, disabled-state, and callback behavior across Control UI pages.
Reason: The maintainer-authored direction aligns with existing consolidation work, reduces production code, and preserves domain ownership without adding settings or public contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the consolidation is useful and preserves existing ownership, but the moved skill-file label requires a raw-copy baseline update before CI can pass.

Priority: P3
Reviewed head: f12e3c40be35a2a69eb89524ef417e4efae22e74

Before merge

  • Regenerate the raw-copy baseline after moving the file label (P2) - Moving SKILL.md from <option> text into label: "SKILL.md" changes its collector entry from html-text:text to object-property:label. The committed ui/src/i18n/.i18n/raw-copy-baseline.json still contains the former entry, and syncControlUiRawCopyBaseline rejects any such mismatch. Consequently, pnpm ui:i18n:verify cannot pass with this source and baseline, consistent with the failed source-verification CI step. Run pnpm ui:i18n:baseline and commit the generated delta while preserving the literal filename.

Findings

  • [P2] Regenerate the raw-copy baseline after moving the file label — ui/src/pages/skills/library-view.tsx:339-340
Agent review details

How this fits together

Control UI pages supply option values, labels, disabled states, and callbacks to a shared Solid renderer, which produces native select elements while existing domain owners retain validation and mutation authority.

flowchart LR
  A[Page state and option labels] --> B[SettingsSelect]
  B --> C[Native select and options]
  C --> D[Existing page callback]
  D --> E[Existing domain owner]
Loading

Technical review

Best possible solution:

Retain the shared renderer and regenerate the raw-copy baseline to reflect the unchanged SKILL.md label's new source representation.

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

Source inspection establishes the baseline mismatch: the collector records literal label properties separately from JSX text, and verification compares the complete generated baseline; no target code was executed.

Is this the best way to solve the issue?

The stateless shared renderer is a proportionate consolidation: callers retain their callbacks and specialized selectors remain local, with only the generated raw-copy baseline missing from the cutover.

Full review comments:

  • [P2] Regenerate the raw-copy baseline after moving the file label — ui/src/pages/skills/library-view.tsx:339-340
    Moving SKILL.md from <option> text into label: "SKILL.md" changes its collector entry from html-text:text to object-property:label. The committed ui/src/i18n/.i18n/raw-copy-baseline.json still contains the former entry, and syncControlUiRawCopyBaseline rejects any such mismatch. Consequently, pnpm ui:i18n:verify cannot pass with this source and baseline, consistent with the failed source-verification CI step. Run pnpm ui:i18n:baseline and commit the generated delta while preserving the literal filename.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm ui:i18n:verify
  • git diff --check

What I checked:

  • Pinned introduced change: The introduced diff extracts a stateless native select renderer and replaces repeated option loops without changing the existing mutation callbacks. (ui/src/components/solid/settings-select.tsx:12, f12e3c40be35)
  • Concrete raw-copy baseline drift: The SKILL.md label changes from JSX text to an object-property label, but the unchanged baseline still records html-text:text for library-view.tsx; the collector distinguishes those categories and verification rejects any mismatch. (ui/src/pages/skills/library-view.tsx:340, f12e3c40be35)
  • Verification gate: The ui:i18n:verify command calls raw-copy baseline verification, and the reviewed head's control-ui-i18n job failed its Verify Control UI i18n source step. (scripts/control-ui-i18n-verify.ts:434, f12e3c40be35)
  • Inspected visual evidence: All four prepared screenshots were inspected: the before/after desktop and mobile captures preserve the visible appearance-settings controls and selections; these are synthetic production captures made through a Playwright harness. (f12e3c40be35)
  • Preserved rejection behavior: Both execution-approval target callbacks retain their explicit native-value rollback, and the existing consumer test covers keeping the selected node until its owner accepts a change. (ui/src/pages/devices/view.execution.test.ts:94, f12e3c40be35)
  • Existing consolidation direction: Control UI: consolidate select controls #151482 requests shared select presentation while preserving interaction and contextual differences; this PR addresses a narrower native-rendering portion.

PR surface

Source -38, Tests +50. Total +12 across 11 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 10 135 173 -38
Tests 1 50 0 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 185 173 +12

Review metrics

Metric Value Why it matters
Production versus test LOC Production −38 net lines; tests +50 lines A small shared renderer removes repeated production markup, while one focused test protects selection, option retention, disabled-state updates, and replacement handlers.

Labels

Label changes:

  • add P3: This is behavior-preserving UI cleanup with a narrow generated-baseline repair, rather than an urgent user-facing defect.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is behavior-preserving UI cleanup with a narrow generated-baseline repair, rather than an urgent user-facing defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 24, 2026, 3:24 PM ET / 19:24 UTC.

@steipete
steipete disabled auto-merge October 24, 2026 19:28
@steipete
steipete merged commit 325c87d into main Oct 24, 2026
94 of 96 checks passed
@steipete
steipete deleted the solid2/w-ui-arch-census branch October 24, 2026 19:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with prior CI and scoped validation.

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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant