Skip to content

refactor(ui): use native plugin presentation state and lifecycle - #179352

Merged
steipete merged 1 commit into
mainfrom
solid2/w-s2-app-lib-followup
Oct 21, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-s2-app-lib-followup

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Whole-scope Solid 2 census, base 2db57c72 → 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 1, deferred with read 0 0 0 6/6
lib, excluding reactive (345 files) 0/10 0/5 2 1 controller, 3 commands 0/10 1 tab-focus slot 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 0
plugin SDK/DOM bridges (5 files) 0 1 → 0 / 2 → 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,586 → 91,590 across 566 files. Plugin totals: 12 intrinsic handlers; cleanup calls 4 → 3; signals 10 → 9; stores 0 → 1; structured signals 3 → 2. The summary history signal is counted under the pending async read; settings props are opaque SDK data. No unsafe intrinsic binding was found. App/lib rows are inventory for the subsequent focused PRs, not claims that their open candidates are complete.

What Problem This Solves

Plugin dashboard presentation still copied its whole local state object for each tab or collapse change, and the plugin host kept component teardown separate from its settled lifecycle.

User Impact

Behavior is unchanged: refreshes retain local choices, replacement sessions initialize after their first snapshot, and retired plugin views release their handles. No routes, tags, selectors, CSS, or markup change.

Why This Change Was Made

Use a writable derived Solid 2 store for dashboard presentation, and pair plugin focus registration with teardown in onSettled. The shallow store preserves the raw immutable scope identity; the existing provider remains authoritative for transport, permissions, and mutations.

Production LOC in the two files: 675 → 679 (+4). Dashboard: 245 → 248; plugin view: 430 → 431. The explicit draft setters and complete store seed account for the small growth. Two object-spread mutation copies and one component-level cleanup disappear. No test code added.

Evidence

Proof Result
pnpm tsgo:ui (tsrs) Pass
Two scoped suites through scripts/run-vitest.mjs, --maxWorkers=1, pinned Bun 27 tests pass
Targeted lint / formatting / git diff --check Pass; two existing adapter reactivity warnings
Production Knip Pass; no production dead exports or dependencies
Base/head pnpm ui:build Pass on both
Strict performance, base → head Startup 331,224 → 331,219 B gzip (−5); Chat 1,500,644 → 1,500,625 (−19); New 1,018,022 → 1,018,024 (+2); startup CSS 1 request / 40,439 B
Independent Codex P0–P2 review Scoped-clean; no actionable findings

Both strict checks report the pre-existing startup and Chat caps; the same-machine head comparison adds no growth to either over-budget surface. New Session remains under its cap. All 21 locale pairs remain under 307,200 B; the largest is 181,712 B, with 4 B maximum pair growth. No old campaign ceiling is used.

The first local test invocation accidentally used direct Vitest/Node; the required run through the pinned Bun launcher passed all 27 tests. No local E2E or parity suite ran. Existing tests exercise delayed first snapshot, replacement scope, manual collapse, permissions, reconnect, plugin update failure, delegated mounts, and callback retirement. This is a state/lifecycle refactor with no visual design change.

Remaining scope and deliberate exceptions
  • Items 3–4: async-and-actions.md is absent on this base; recipes PR refactor(ui): add Solid async recipes and cron reference #179123 remains open. Remaining local reads: app focus-dashboard route, MCP discovery, board-browser inspect, plugin session history. Local mutation controllers: app update confirmation, board-browser open/resume/stop, plugin contribution invocation. Plugin reload already uses action and an optimistic saving flag. Conditional MCP session creation is a service-owned preparation write.
  • Item 6: lib tab focus will move to a store separately. App's other five structured signals are synchronous owner/external snapshot receipts. The bridge callback envelope and opaque plugin props remain identity-bearing external data.
  • Item 10: app delayed shell connect, lazy automation readiness, and detached commit settlement have six calls requiring an explicit ownership cutover. Lib's bridge and inert SVG snapshot, plus plugin SDK mounts, are foreign-DOM adapters with matching cleanup.
  • Item 7: three createComponent calls remain in the generic foreign-DOM bridge; converting its explicit .ts import path would touch 102 production callers or require a compatibility facade. It remains the single renderer adapter, not a parallel view implementation.
  • Item 5: remaining imports activate imperative owners, custom-element registrations, SDK mounts, parsers, or storage. Native lazy components already cover the app views. Dashboard's async module memo already has Loading/Errored and retry-pending presentation.
  • Item 9: the six app Loading boundaries are mutually exclusive or separate surfaces; no demonstrated sibling group needs Reveal.
  • Primitive cleanup remains synchronous for projection subscriptions, ref registration, property descriptor teardown, and provider-lease computations.

Exact-name CI attribution

CI run 39581796376 fails only the following two test cases (plus the downstream CI gate), both reproduced by the latest completed scheduled main run 39578067192 at 94e1fbf31a1371ab4ebd5fbdc24c860f1169e67b:

  • Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannot — outbound transport timeout at qa-transport.ts:178, called from test line 308.
  • Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width — containment assertion at test line 214.

The exact names, assertion signatures, and test/helper blobs match main. All other substantive jobs, including security-fast, passed. Landing uses the native documented inherited-failure route; these failures are not relabeled green.

@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-21T10:16:08.736039Z 7e25c0c 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 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 changes before merge.

What this changes

This PR replaces dashboard object-signal updates with a shallow derived store and pairs plugin focus registration with settled lifecycle cleanup.

Example: Select the Research tab, collapse the dashboard, then receive board revision 2.

  • Before: Research remains selected and the dashboard remains collapsed using object-signal updates.
  • After: The same choices remain intact using store draft updates.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-reviewed implementation with relevant existing component coverage; supplied media is off-target and current CI failures remain unattributed.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; reported component tests support the changed owners, while inspected automation screenshots do not demonstrate dashboard retention or plugin teardown.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; dashboard choices and plugin-view cleanup must retain their existing behavior.
Reason: The maintainer-authored direction aligns with the repository's native Solid guidance and removes object-replacement mutations and separate component cleanup without introducing another owner.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed refactor preserves existing ownership contracts, with no actionable source finding; current CI failures still need attribution.

Priority: P3
Reviewed head: 7e25c0cc0d024eb0af764c23161f152a5ad0f7a8

Before merge

  • Complete next step - Determine whether the failed Markdown reading-width and automation-management checks are caused by this PR or independently present on its baseline.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-entry-point evidence exercises dashboard choice retention and plugin-view disposal on this head.
Agent review details

How this fits together

The Control UI plugin presentation layer consumes scoped board-provider snapshots and plugin registrations, renders dashboard and replacement views, and releases mounted handles when their owner ends.

flowchart LR
  Gateway[Gateway snapshots] --> Provider[Board provider lease]
  Provider --> Presentation[Dashboard presentation store]
  Presentation --> Board[Board view]
  Registry[Plugin runtime registrations] --> Host[Plugin view host]
  Host --> Lifecycle[Settled setup and cleanup]
Loading

Technical review

Best possible solution:

Retain the focused store and lifecycle conversion while preserving provider authority, scope identity, manual choices, and teardown behavior.

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

Is this the best way to solve the issue?

The conversion uses existing Solid primitives and existing domain owners, with a complete seed and shallow scope identity rather than a parallel presentation implementation.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Dashboard presentation reconciliation keeps the original intent (a5959e0: Replace effect-based synchronization with a writable derivation while retaining manual choices and delayed snapshot initialization.)
  • Plugin focus registration and mounted-view disposal keeps the original intent (939f740: The Solid port retained plugin view state and ensured retired owners release their handles; later ownership refactors preserved the foreign-DOM boundary.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +4. Total +4 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 52 48 +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 2 52 48 +4

Labels

Label changes:

  • add P3: This is an internal presentation-state and lifecycle refactor with no intended user-visible behavior change or established urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal presentation-state and lifecycle refactor with no intended user-visible behavior change or established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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:23 AM ET / 10:23 UTC.

@steipete
steipete merged commit e0a0bbc into main Oct 21, 2026
114 of 120 checks passed
@steipete
steipete deleted the solid2/w-s2-app-lib-followup branch October 21, 2026 11:28
@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: ⏳ 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