Skip to content

refactor(ui): settle shell commits in the rendered lifecycle - #179478

Closed
steipete wants to merge 1 commit into
mainfrom
solid2/w-s2-shell-commit
Closed

steipete wants to merge 1 commit into
mainfrom
solid2/w-s2-shell-commit

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Whole-scope Solid 2 census at base 93a248d1f9db. Counts are before → after; unchanged values appear once. Presentation candidates exclude synchronous domain-owner authority and foreign-DOM adapters.

File family 1 unsafe/native bindings 2 component/all cleanup 3 manual reads 4 local mutations 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 0 0 0 6/6 → 5/5
lib excluding reactive (345 files) 0/10 0/5 2 1 controller + 3 commands 0/10 1 tab-focus slot, separate PR 3 foreign-DOM calls 0 0 0/4
plugin presentations (5 files) 0 0/2 1 1 raw + 1 native action 0/1 1 history slot 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

Production census: 566 files; 91,604 → 91,595 LOC. App: 31,376 → 31,367; lib: 54,223; plugins: 3,903; API: 2,102. Counted tracked production TS/TSX, excluding declarations, tests/test support, and lib/reactive.

What Problem This Solves

The synchronous shell owner scheduled DOM completion through an unowned Solid callback and kept a separate pending-commit token. Make the rendered shell own that callback instead: a renderless keyed branch registers onSettled for each shell view snapshot, outside the route-readiness boundary. The synchronous owner retains its coalesced completion promise; mount/resume invalidate, completed rendering settles it, and unmount settles outstanding work as false.

This removes the detached scheduler and its token without a microtask hop. Commit callbacks stay in the same Solid drain, preserving focus restoration ordering. No visible markup, selectors, routes, classes, lazy imports, or domain authority changes. The narrow commitRenderedPresentation() host contract is inline so this PR does not edit the separately claimed shell-view-state interface.

Evidence

Proof Result
pnpm tsgo:ui (tsrs) Pass
pnpm test ui/src/app/app-host.test.ts --maxWorkers=1 Local setup failure: Vitest worker startup timed out before any tests/assertions ran; full CI required
Controller guard and pruned baseline Pass; one runWithOwner allowance removed
Formatting / git diff --check Pass
Scoped lint Pass
Independent isolated Codex review Pass: scoped-clean; final source verification complete
Production Knip Pass on final source
Same-machine base/head UI builds Pass
Startup JS gzip 331,314 → 331,327 B (+13 B)
Chat boot JS gzip 1,500,965 → 1,500,936 B (−29 B)
New Session boot JS gzip 1,018,351 → 1,018,322 B (−29 B)
Startup CSS 1 request; 40,439 B unchanged

The existing disposed-caller regression now mounts the real shell with its runtime. It keeps the same assertions for coalesced promise identity, completion after caller disposal, and false settlement on unmount. No assertion was removed. No local E2E or parity battery runs; ci:full supplies all UI and Gateway shards. The local worker-start timeout is a setup gap, not a product pass or test assertion failure.

Touched production LOC: 675 → 666 (−9) across two files; test LOC 1,078 → 1,080 (+2). Pending scheduler tokens 1 → 0 and detached owner calls 1 → 0. Other checklist candidates in these two production files remain zero; native-history state retains its raw external-owner snapshot. No new effects, state owners, or dependencies were added.

Remaining scope

  • The other five app owner calls are the separate app-ownership cutover; this PR removes the scheduler call they intentionally retain. App-host test overlap is limited to the existing disposed-caller regression; no readiness or subscription design changes.
  • Canonical async/action recipes are absent from fetched main. Focus routing, plugin history, MCP discovery, and browser-dashboard reads/mutations remain queued with their cancellation, pacing, canonicalization, and serialized command authority preserved.
  • Tab focus and recovery-dialog objects are separate focused PRs. Command-palette input custody, raw native-history snapshots, exact committed router receipts, bridge values, and SDK props retain their identity/opaque contracts.
  • Remaining cleanup hooks are tied to reactive runs or primitives; remaining manual component factories/owner APIs mount foreign DOM islands. No throw-only context wrapper or demonstrated sibling-loading group remains.

The strict checker exits 1 for existing absolute startup and Chat caps on both base and head. Startup growth is 13 B, below the 64 B limit, while both route payloads shrink. No budget or baseline is increased. The staged baseline and its final published metrics are byte-for-byte identical.

@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:56:13.988902Z 9bf079d 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 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 moves shell commit acknowledgement into the rendered Solid lifecycle and removes the detached scheduler token.

Example: Opening the mobile navigation drawer waits for committed DOM before moving keyboard focus.

  • Before: A detached callback acknowledges the shell update.
  • After: The rendered shell acknowledges the update while preserving the existing completion promise and focus ordering.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent with strong supporting CI; direct evidence of the changed browser lifecycle remains limited.
Proof confidence 🦐 gold shrimp (3/6) The supplied instructions identify this as maintainer-authored and outside the ordinary contributor proof gate; inspected evidence comprises builds, static validation, and passing CI rather than a recorded browser exercise of the changed settlement path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Navigation focus and lazy actions must observe committed shell DOM even when the caller that invalidated it has retired.
Reason: The supplied maintainer direction authorizes a narrow simplification that removes detached lifecycle machinery while retaining the existing behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, maintainer-directed lifecycle simplification with no concrete introduced defect found; current main still uses the detached scheduler.

Priority: P3
Reviewed head: 9bf079d0f91f02da83f48d72a4828728636b4469

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied browser trace specifically demonstrates commit-driven focus restoration and shell retirement after this cutover; the existing test preserves those completion contracts without a claimed red-on-base regression.
Agent review details

How this fits together

The Control UI shell projects synchronous application state into Solid-rendered navigation and routes; commit receipts let focus and lazy actions wait for DOM updates.

flowchart TD
  A[Application state changes] --> B[Shell presentation owner]
  B --> C[Shell revision]
  C --> D[Rendered shell snapshot]
  D --> E[Owned settled callback]
  E --> F[Commit receipt and chrome updates]
  F --> G[Focus and lazy action consumers]
Loading

Technical review

Best possible solution:

Use the rendered shell lifetime to acknowledge commits while retaining synchronous state ownership, coalesced promises, same-drain ordering, and false settlement on disposal.

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

This refactor establishes no new failing user scenario; source inspection confirms the detached scheduler and the existing caller-disposal contract it replaces.

Is this the best way to solve the issue?

The change is a small complete cutover: the existing renderer owns acknowledgement, the synchronous owner retains completion state, and the replaced scheduling path is removed.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shell commit scheduling changes intended behavior with a stated reason (9548737: Settlement was detached from transient callers so their disposal could not strand shell completion.)
  • Shell rendering and route readiness keeps the original intent (refactor(ui): render the app shell and retained routes with Solid #168612: The Solid shell preserves route, DOM, focus, and retained-content lifetimes.)
  • Owner-call baseline keeps the original intent (be00d75: Shrink-only baselines prevent new manual owner-call debt.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -9, Tests +2, Other -1. Total -8 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 37 46 -9
Tests 1 5 3 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 4 42 50 -8

Review metrics

Metric Value Why it matters
Production versus test growth Production −9 lines; tests +2 lines The change removes scheduler machinery and adapts an existing behavioral test to mount the actual shell.

Labels

Label changes:

  • add P3: This is a behavior-preserving lifecycle cleanup with no established current user-facing failure.
  • 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 a behavior-preserving lifecycle cleanup with no established current user-facing failure.
  • 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • A browser trace showing drawer or sidebar focus restoration across shell updates would strengthen the lifecycle 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 21, 2026, 9:08 AM ET / 13:08 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #180137, merged as 55d5c93 after current-head full CI passed. The replacement preserves this shell lifecycle change and uses the current native landing workflow.

#180137

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