Skip to content

refactor(ui): simplify systems and portals ownership - #173780

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

steipete merged 1 commit into
mainfrom
solid2/w-idiom-pages-surfaces

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Systems and Portals render in Solid but still retain controller classes and forwarding adapters. Systems also searches the DOM to forward desktop requests.

User Impact

No intended behavior change. Systems keeps cached selection, search, filters, and sort across navigation; sidebar observation remains passive. Portals keeps iframe identity, probe reuse, environment polling, synchronous request admission, and one presentation receipt per command.

Why This Change Was Made

Replace the classes with createSystems and createPortals. Systems remains a plain route-cached owner because the sidebar and page share its identity and retained preferences; mounted Solid views own observation and active reads. Portals owns its subscriptions and cleanup within the component. Command receipts remain explicit synchronous transitions. A branch-owned desktop ref replaces the DOM query.

Touched production files: 2,466 → 2,461 LOC (-5). Test LOC: 1,367 → 1,373 (+6). Controller references: 24 → 0; createEffect: 4 → 4; untrack: 0 → 0; addEventListener: 2 → 2, paired with cleanup. Counts include imports and exclude AbortController. Lazy route modules, host tags, classes, and selectors remain intact.

Evidence

Proof Result
UI typecheck Passed
Systems page 13 tests passed once, covering cached preferences, passive sidebar, request retirement, and desktop retention
Portals page 17 tests passed once, including probe reuse and presentation receipts
Focused lint / diff check Passed
Production Knip Passed
Independent review Scoped-clean P0–P2
Production builds Baseline and candidate passed on the same Mac
Strict startup gzip 347,708 → 347,694 B (-14 B); 8 JS requests on both sides
Startup CSS 1 request, 38,844 B gzip on both sides
Synthetic captures Populated Systems with details open and a locally mocked Portals iframe with an edited note; both pixel-identical

Broad proof runs in PR CI with ci:full. No local full suite or parity run was used.

The complete 1280×900 dark captures were inspected and contain only synthetic data. Contact sheets are ordered Systems, Portals. The first baseline capture used mismatched fixture build identity; the corrected harness reads each build’s actual identity. No build or passing test suite was repeated.

The Systems sort/filter test emits pre-existing NO_OWNER_EFFECT diagnostics: the unchanged shared Menu activation path reads inline JSX items outside an owner. Source comparison against the base confirms the same item construction and event path; this attribution is not a baseline runtime replay.

Before: populated Systems and Portals

After: populated Systems and Portals

@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-16T04:15:02.907869Z 27acd1f 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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 Systems and Portals controller classes with factory-owned state and forwards desktop requests through an owned element reference.

Example: Open Systems with Demo Gateway selected, then view the Garden planner portal.

  • Before: Systems shows machine details and Portals shows the application preview.
  • After: The inspected captures show the same content and appearance with the simplified ownership.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The scoped refactor is coherent and source-reviewed with no actionable findings; browser captures establish visible parity, while lifecycle behavior is supported by rendered-page tests.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected baseline/candidate production-build browser captures show matching Systems details and a populated synthetic Portals iframe; existing rendered-page tests support preference retention, request retirement, iframe identity, and synchronous receipts.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No new user-facing defect is claimed; the maintenance problem is controller and forwarding machinery remaining after the Solid migration.
Reason: The maintainer-authored direction simplifies existing ownership without adding settings, dependencies, public APIs, or competing state.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a useful maintainer-directed refactor with no actionable correctness or security findings; the real-Gateway CI shards remain pending.

Priority: P3
Reviewed head: 27acd1f4c0e17ca618780576d3bf8b28ad40ad1f

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI owners consume Gateway snapshots, events, and user actions, then supply machine inventory, desktop presentation, portal previews, and presentation receipts to Solid views.

flowchart TD
  A[Gateway snapshots and events] --> B[Systems route owner]
  A --> C[Portals component owner]
  B --> D[Systems page and sidebar]
  D --> E[Desktop panel reference]
  C --> F[Portal iframe]
  C --> G[Presentation receipts]
Loading

Technical review

Best possible solution:

Retain the single synchronous owner for each page and complete the existing exact-head CI and landing workflow.

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

This is a behavior-preserving refactor rather than a reported bug; source and supplied evidence were inspected without executing target code.

Is this the best way to solve the issue?

The approach preserves synchronous state and existing lifecycle boundaries while deleting the replaced implementations and removing DOM lookup for desktop forwarding.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Systems rendering and route lifecycle keeps the original intent (c3e5d7b: Use the native lazy Solid route while preserving cached selection, passive sidebar observation, and pending desktop setup across equal route refreshes.)
  • Solid page ownership and retained views keeps the original intent (939f740: Keep one renderer per tag, synchronous domain decisions, retained iframe identity, and retirement of work from replaced owners.)
  • Portal presentation receipts and probe reuse keeps the original intent (f4ba015: Report requesting-browser access outcomes honestly and preserve the live iframe when a portal is presented again.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c3e5d7b adds ui/src/pages/systems/systems-page.tsx:149 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c3e5d7bbd4c7; files: ui/src/pages/systems/systems-page.tsx)

PR surface

Source -5, Tests +6. Total +1 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 9 1172 1177 -5
Tests 2 70 64 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 1242 1241 +1

Labels

Label changes:

  • add P3: This is an internal ownership cleanup with no intended user-visible behavior change or demonstrated urgent defect.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is an internal ownership cleanup with no intended user-visible behavior change or demonstrated urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • 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 16, 2026, 12:25 AM ET / 04:25 UTC.

@steipete
steipete merged commit 788c2ae into main Oct 16, 2026
102 of 103 checks passed
@steipete
steipete deleted the solid2/w-idiom-pages-surfaces branch October 16, 2026 05:19
@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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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