Skip to content

refactor(ui): own desktop session subscriptions in Solid - #174170

Merged
steipete merged 2 commits into
mainfrom
solid2/w-idiom-components-desktop-session-source
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-idiom-components-desktop-session-source

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Desktop session and availability requests still depended on a Lit-era subscription controller and host-wide update callback. That coupled synchronous target admission to the panel's old lifecycle.

User Impact

Desktop selection, startup polling, lock-state feedback, reconnect, and stale-result rejection keep their existing behavior. Native methods can still act before the Solid view mounts. Tags, selectors, markup, styles, and lazy boundaries are unchanged.

Why This Change Was Made

Keep DesktopSessionOwner as a plain TypeScript domain owner: request generations, current targets, and startup state require synchronous decisions. Remove its structural host dependency and SubscriptionsController registration. DesktopPanelContent selects the gateway client through a memo and owns the subscription through a split effect with returned cleanup. Existing parent projection publishes the aggregate view, so this adds no second store or child projection.

Retain the session owner’s existing pure target-change predicate. Remove two redundant notifications from synchronous selection paths that already scheduled the same render before their next await; no extra helper or copied state is introduced.

Evidence

Proof Result
Codemod Dry-run completed; subscription and host-update markers resolved.
Availability boundary Initial candidate: 4/4 passed, one worker, 17.03 s runner. Final gateway-replacement case: 1/1 passed, 9.44 s runner, after correcting eager memo setup order. After the keyboard merge repair, the complete availability file passes 4/4 again (10.91 s runner). Existing reconnect proof checks unsubscribe and no post-unmount requests; replacement proof emits on the new gateway and checks rendered lock feedback without reconnecting RFB.
UI types Passed again after the keyboard merge repair.
Lint / format / diff Passed on the final candidate, including the panel line cap.
Production Knip Passed again on final replacement head with the full production command; no ignores added.
Independent review Final isolated P0–P2 review completed scoped-clean.
Full UI / E2E / real-Gateway Final replacement-head run 38898154138 is fully green with ci:full; every selected check passes. The earlier Models-layout and assertion-ratchet failures are resolved on this run.
Startup performance Final paired CI passes: startup JS 339,453 B gzip / 7 requests; CSS 38,786 B / 1 request unchanged. Chat boot 1,653,643 → 1,653,678 B (+35 B); new-chat boot 1,343,835 → 1,343,904 B (+69 B). Base startup-JS total is not separately printed. No boot imports or lazy boundaries changed.

This is a lifecycle-only refactor; no screenshots, local E2E/parity runs, or remote test leases were needed. Broader startup, target switching, and document-state cases run in PR CI.

Touched production metric Before After
LOC 1,112 1,110
Controller/lifecycle checklist references 7 1
createEffect 1 2
createRenderEffect 0 0
untrack 0 0
addEventListener 3 3
DOM queries 2 2
Hand-built class strings 0 0
Production flush 0 0
runWithOwner / getOwner 0 0

Production shrinks by 2 lines across three files. The new effect owns an external gateway subscription, not a copied value; its memo keeps the subscription stable across unrelated panel publications. The remaining checklist reference is the separate panel controller, whose larger render-fence cut is coordinated with the other panel consumers. The existing noVNC DOM island and lifetime-stable panel adapter remain outside this cut; main’s keyboard ref and factory remain intact.

The client memo is created after the panel render source binds: rc.14 computes memos eagerly, so creating it earlier would miss later client changes. The replacement-gateway case proves that new lock feedback renders without reconnecting RFB. Test LOC is 232 → 244 (+12).

Performance evidence: run 38898154138, job 116963950544, tested merge 25a59e9c8fe11f0b0fea95afefe1c01fe559e903.

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

@steipete
steipete marked this pull request as ready for review October 16, 2026 11:32
@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-16T12:14:26.124731Z 611f1d6 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.

@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 moves Desktop gateway subscription lifetime into Solid while retaining synchronous session-target and availability ownership.

Example: A Desktop panel viewing node:other switches gateway clients, then receives a locked-state event.

  • Before: The legacy subscription controller delivers the event and updates lock feedback.
  • After: The Solid-owned subscription delivers the same feedback without reconnecting the desktop viewer.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The source change is coherent and has focused mounted-panel coverage, but supplied behavioral evidence remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) Under the supplied maintainer-authored exemption, ordinary runtime proof is not required; reported mounted-panel validation exercises cleanup and replacement-gateway feedback, with no new authority boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Desktop behavior is intended to remain unchanged while its subscription lifetime follows the mounted Solid view.
Reason: The supplied maintainer-authored direction follows repository ownership guidance, removes legacy lifecycle wiring, and adds no product surface or competing state owner.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-directed refactor open: it completes a coherent lifecycle cutover, with no actionable correctness or security findings; both failing CI signatures also occur on other PRs.

Priority: P3
Reviewed head: 79f2712455cd34a4cb94b98887d158fad6bcc2f1

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied execution evidence covers mounted panels with mocked gateway and RFB clients, rather than this subscription cutover through a shipped browser and real gateway.
Agent review details

How this fits together

The Control UI Desktop panel consumes gateway inventory and session events, resolves the selected machine, and publishes availability and connection state to its Solid presentation.

flowchart LR
  A[Desktop Solid component] --> B[Client memo and subscription effect]
  B --> C[Gateway event stream]
  C --> D[Desktop session owner]
  D --> E[Desktop panel controller]
  E --> F[Desktop presentation and viewer]
Loading

Technical review

Best possible solution:

Retain this focused Solid lifecycle cutover and preserve the existing synchronous session and connection owners.

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

There is no reported behavioral defect to reproduce; inspection confirms a lifecycle refactor, and no target code was executed.

Is this the best way to solve the issue?

A memo-selected subscription effect fits Solid ownership while the plain TypeScript owner preserves synchronous admission and stale-result rejection.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -2, Tests +12. Total +10 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 97 99 -2
Tests 1 13 1 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 110 100 +10

Review metrics

Metric Value Why it matters
Production versus test LOC Production −2 net lines; tests +12 net lines The lifecycle cutover reduces production code while extending existing cleanup and gateway-replacement coverage.

Labels

Label changes:

  • add P3: This is an internal lifecycle refactor with no intended user-visible behavior change.
  • 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 an internal lifecycle refactor with no intended user-visible behavior change.
  • 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, 7:49 AM ET / 11:49 UTC.

@steipete
steipete merged commit e2b2ea4 into main Oct 16, 2026
104 of 105 checks passed
@steipete
steipete deleted the solid2/w-idiom-components-desktop-session-source branch October 16, 2026 12:34
@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: M 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