Skip to content

refactor(ui): own board presentation state in Solid - #174033

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

steipete merged 1 commit into
mainfrom
solid2/w-idiom-components-board

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Board renderer still uses a mutable BoardViewState class plus requestUpdate to refresh local presentation state during the Solid migration.

User Impact

No user-visible change. Same-turn resize, retained widget identity, focus, announcements, and awaited MCP teardown preserve their existing behavior. Routes, tags, CSS, rendering markup, and lazy import boundaries stay unchanged. No dependencies were added.

Why This Change Was Made

Replace the rendering adapter with an owner-scoped createBoardViewState factory and a derived Solid store for presentation. Ordered tabs and the active tab are shared memos, and grid geometry uses a captured ref.

Gesture identity and mutation admission remain synchronous plain TypeScript. Pointer-up consumes its final calculated geometry directly, so a down/up pair in one turn still resizes correctly. Owner cleanup cancels pointer listeners without publishing state; retained widgets and awaited teardown keep their existing owners. Repeated equal-height reports remain a no-op. The grid helper's get-only input type narrows its existing contract without changing runtime behavior.

Evidence

No local startup build was run under the campaign's bounded proof policy because this changes no boot/startup code. CI built both sides on the same runner and passed the strict performance comparison below.

Proof Result
Codemod dry-run on both Board view files before editing Manual state/lifecycle conversion identified and completed; no remaining markers
pnpm tsgo:ui Passed on final source
Prior-source Board view suite, one worker 26/26 passed; includes same-turn pointer-up resize regression
Focused loading-readiness case after readiness/height-receipt refinement Passed; full final-source suite also passed in CI
Warning attribution: identical focused case on baseline Passed; same retained-cell ref warning and stack reproduced
Targeted lint, exact-file format, git diff --check Passed
Production Knip Passed
Exact-head full CI 38875160304 Passed: all 3 UI unit shards, all 9 mocked UI E2E shards, both real-Gateway shards, performance, and ci-gate; all 63 jobs successful/skipped
Same-runner build and strict performance comparison Passed: startup JS 339,355 B gzip / 7 requests; startup CSS 38,786 B gzip / 1 request
Isolated review with complete grid/callback/retention/runtime context Scoped clean, no P0–P2 findings

The remaining generic STRICT_READ_UNTRACKED diagnostic comes from the unchanged retained-cell ref's stable key read. A temporary console hook traced it to the same ref callback on both baseline and candidate; the hook was removed. The readiness callback intentionally samples native child readiness after DOM commit, while its containing split effect tracks view invalidation and child presentation events invoke the same sample.

Touched production metric Before After
LOC 1,176 1,175
Controller references, including callback/type references 14 0
Checklist call-pattern controller lines 11 0
createEffect 1 1
createRenderEffect 0 0
untrack 0 1
addEventListener 4 4
DOM queries, including typed calls 7 5
Checklist literal-query pattern lines 4 4
Hand-built class strings 0 0
flush calls 0 0
runWithOwner / getOwner calls 0 0

Production LOC falls by 1 across the three touched production files; the regression adds 20 test lines. The class and its rendering-invalidation wiring are removed together. The remaining explicit listeners are gesture-scoped or media-query listeners with paired cleanup. There is no visual design change requiring screenshots.

The CI performance comparison built tested merge 2cf78cedb6eb41b5fa84b7cf24a2829e1c4a66e0 (head 8b951f1a391d9e1c68e2ee6400d08e17b852d5e9) against base a9e85bfa0f2104543254675a1a950d3f2237714c on the same runner with Node v24.21.0, Vite 8.3.4, and Pako 3.0.2. Startup JS stays below the original 374,285 B gzip budget; startup CSS is unchanged at 38,786 B gzip and one request.

@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-16T08:44:14.957821Z 8b951f1 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 replaces the board’s mutable presentation controller with an owner-scoped Solid store and shared tab memos.

Example: Resize the alpha widget from 6×4 to 6×6 using pointer-down and pointer-up in one event turn.

  • Before: The mutable controller calculates and submits the final size synchronously.
  • After: The Solid presentation store displays the interaction while synchronous gesture state still submits the final 6×6 size.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A coherent, focused cutover with useful component coverage and no actionable finding; supplied behavior evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts this PR from the contributor proof gate; its evidence covers component behavior and checks, with no shipped-entry-point demonstration supplied.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Board presentation updates still require a mutable controller and manual renderer invalidation.
Reason: The maintainer-authored direction matches the ongoing Solid migration and removes the old adapter without adding a competing domain owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authorized refactor completes the board presentation-state cutover without a concrete correctness or security finding.

Priority: P3
Reviewed head: 8b951f1a391d9e1c68e2ee6400d08e17b852d5e9

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI board consumes session snapshots and pointer or keyboard input, renders retained widget cells, and sends mutations through the existing board provider.

flowchart LR
  Snapshot[Board snapshot] --> State[Solid presentation owner]
  Input[Pointer and keyboard input] --> Gesture[Synchronous gesture state]
  Gesture --> State
  State --> Cells[Retained widget cells]
  Gesture --> Provider[Existing board provider]
  Provider --> Gateway[Gateway board operations]
Loading

Technical review

Best possible solution:

Complete the Solid presentation cutover while preserving synchronous gesture admission and the existing provider and widget lifecycles.

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

This is a behavior-preserving refactor, not a reported defect; source and component coverage were inspected without executing target code.

Is this the best way to solve the issue?

The change follows the repository’s Solid ownership model, removes the superseded controller, and keeps synchronous decisions outside reactive presentation state.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Board presentation controller and retained rendering changes intended behavior with a stated reason (939f740: The earlier Solid port preserved synchronous interactions, iframe identity, and awaited teardown while moving the interaction class into a sibling file.)
  • Tab selection and widget actions keeps the original intent (e80a1e5: Owned Solid controls preserve tab IDs, drag targets, focus, and action behavior.)
  • Grid sizing input keeps the original intent (0485ca2: Fullscreen widget sizing shares board geometry while page controls move into the existing menu; the helper only consumes height lookup.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Complete introduced cutover: The pinned introduction removes BoardViewState and requestUpdate wiring together, retains synchronous mutation admission, and calculates pointer-up geometry directly. (ui/src/components/board/board-view-state.ts:61, 8b951f1a391d)
  • Existing ownership and retention contracts: Current main retains the original controller. The earlier Solid port explicitly preserves iframe identity, drafts, and awaited MCP teardown; the reviewed change keeps those owners and keyed-cell handling. (ui/src/components/board/board-view.tsx:42, 939f740219d9)
  • Behavioral coverage: The added test drives real board pointer handlers and checks the independent resize operation, cleared drag presentation, and announcement; existing tests cover loading readiness, mutation serialization, session replacement, and retained frames. (ui/src/components/board/board-view.test.ts:716, 8b951f1a391d)
  • Applicable Solid runtime contract: The patch imports createStore from solid-js, pinned to rc.14. Upstream package metadata confirms rc.14 at this revision; its store setter executes draft callbacks synchronously while publication remains deferred, matching the gesture implementation. (packages/signals/src/store/store.ts:2244, 8d23a5a13b23)
  • CI failure classification: The failing PR context check requests authored body headings; its annotations identify no source or test failure. Exact-head UI checks passed, with some E2E checks still running when inspected. (8b951f1a391d)
  • Review scope and local limits: Root and UI policies were read; no deeper UI AGENTS.md or maintainer-notes directory exists. Installed Solid dependencies are absent, so the matching upstream contract was inspected. Some historical blob searches encountered disabled lazy fetching; available history and prior PR descriptions establish the relevant intent. The checkout remains clean. (ui/AGENTS.md:1, 8b951f1a391d)

PR surface

Source -1, Tests +20. Total +19 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 340 341 -1
Tests 1 20 0 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 360 341 +19

Review metrics

Metric Value Why it matters
Production versus test LOC Production −1; tests +20 The controller cutover slightly reduces production code; the added test protects same-turn pointer settlement through the board component.

Labels

Label changes:

  • add P3: Behavior-preserving UI ownership cleanup with no established urgent user-facing 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: Behavior-preserving UI ownership cleanup with no established urgent user-facing 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, 4:54 AM ET / 08:54 UTC.

@steipete
steipete merged commit 2ade584 into main Oct 16, 2026
103 of 106 checks passed
@steipete
steipete deleted the solid2/w-idiom-components-board branch October 16, 2026 10:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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