Skip to content

refactor(ui): use native async boundaries for System busyness - #179755

Closed
steipete wants to merge 2 commits into
mainfrom
solid2/w-s2-debug-async
Closed

steipete wants to merge 2 commits into
mainfrom
solid2/w-s2-debug-async

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

System busyness still maintains separate manual loading/error presentation for its lazy overlay and each diagnostics section.

User Impact

The overlay keeps its expanded and compact loading states, independent live diagnostics, and stale-chunk recovery behavior while moving async presentation to Solid's native boundaries. No configuration or migration is required.

Why This Change Was Made

The lazy module now owns import presentation through lazy, Loading, and Errored; the existing request owner retains replay and dismissal authority. Each diagnostics descriptor exposes its actual request to an independent async boundary, while the synchronous polling owner still handles permissions, cancellation, connection replacement, visibility, and sample history. A shared status memo preserves samples when switching between compact and expanded views.

Settled sections continue refreshing independently: a delayed active-run request does not hold CPU updates or history. A connection epoch clears prior-connection samples immediately. Retry retains its loading presentation while checking reachability, and closing the overlay prevents that pending check from reloading it.

Evidence

Validated signed head d37a184b4bf3594df727b07e3f433aaf66e7201e against official-main baseline c5471a5ffd8df3c4a3766886ff3cfd91c936ad68:

  • All 11 focused Debug tests passed. The added settled-polling contract holds the second active-run read while three separately deferred CPU responses update the view and history.
  • Production-browser proof passed for expanded/compact loading, ready content, a live event update, and three deferred status polls while one active-run request remained held: all three samples appeared, ending at 0.90 CPU cores.
  • Production stale-chunk proof passed: hold the Retry reachability probe, close the overlay, release the probe, and verify no reload and no retained replay action.
  • All eight existing System busyness lazy-recovery E2E cases passed, covering New/Chat frames, dismissal during frame/content loading, and manual/automatic recovery.
  • UI typecheck, scoped typed lint/format, controller guard, diff hygiene, and independent final review passed.

Production builds and strict budget checks passed for both baseline and candidate, including the paired comparison. Startup/Chat/New gzip changed by +23/+42/+44 bytes; raw JS, request counts (8/25/21), and CSS metrics were unchanged. No budget changed.

The two production files change from 473 to 512 lines (+39). Static sites: signals 4→3, createComponent 1→0, onSettled 5→4, and Show 10→9; native lazy 1, Loading/Errored 3 each, memo 2, and optimistic/action 1 each. The increase retains independent pending/error frames and explicit retry ownership.

The screenshots below are inspected synthetic fixtures from production builds, paired before/after for expanded loading, compact loading, and expanded ready. The full-frame settled-target helper could not capture the baseline reliably; the supported viewport helper produced all six images, with matching measured bounds and no page errors. No live Gateway/provider run is claimed by these fixture-based browser checks.

State Before After
Expanded loading Before: expanded System busyness loading After: expanded System busyness loading
Compact loading Before: compact System busyness loading After: compact System busyness loading
Expanded ready Before: expanded System busyness ready After: expanded System busyness ready

Solid 2 checklist

Debug #179755, exact c547 base → d37 head, two touched production modules. Source-inspected normalized checklist; retained native-AST census supports primitive counts. No new tests or source edits.

# Area Before → after / disposition
1 Conditional intrinsic handler bindings 0 → 0. Decisions stay inside stable callbacks; the mode ternary is inside onToggleMode, not a conditional event binding.
2 Component-level onCleanup 0 → 0. onSettled sites 5 → 4: two host-lifetime setups retain paired cleanup, two property-change receipts remain; the manual import-completion receipt disappears.
3 Manual async read presentation 1 shared SectionState map covering 4 descriptors → 0. Actual per-descriptor promises feed native memo/Loading/Errored readers. Null/undefined encode unavailable/not-started admission; synchronous requests, permissions, aborts and polling stay with their existing owner.
4 Data-mutation presentation N/A: 0 → 0 data mutations. This slice reads diagnostics. The local Retry workflow gains 1 action and 1 optimistic value; current request identity and persisted replay still own reload/cancellation authority.
5 Manual component-signal/import loader 1 → 0. Native lazy 0 → 1; the same dynamic import remains deferred. Explicit preload supports existing replay ownership.
6 Object/array signals 2 → 1. The error record disappears. The copied history array remains 1 → 1 at d37; its store conversion belongs to Lifecycle #179161 and must be retained when that official-main change is integrated. Existing section store remains 1 → 1 with promises rather than mirrored status/value records.
7 Handwritten createComponent 1 → 0. The descriptor renderer uses JSX. Shared defineSolidBridge entry points remain unchanged.
8 Throw-only context wrappers 0 → 0. Two useOptionalApplication consumers remain 2 → 2; neither declares a wrapper or rethrows. The optional inherited context is fixed to the bridge lifetime.
9 Sibling loading 1 independently useful 4-section group → 1. Manual SectionState branches disappear; expanded sections have independent native boundaries, compact mode reads the shared status memo. Reveal remains 0 → 0 intentionally: a pending active-run read must not hold CPU/history or already useful sections.
10 Foreign owner API escapes 0 → 0. No createRoot, getOwner or runWithOwner in either touched production file. The two existing defineSolidBridge factories delegate foreign DOM lifetime to the shared bridge owner.

CI qualification

Exact-head CI 39645079134, attempt 1, completed with 30 successful jobs, 26 skipped, seven failed UI shards, and the failed aggregate gate. All 11 failed cases match scheduled main 39644558400 by exact test name and primary error, locator, and first stack frame after timestamp removal. That scheduled main run completed at 18:29:18 UTC; its fresh 18:32 observation qualifies it as the latest completed main run. The previously completed main run passed the outbox case and is not used as matching evidence.

The matching cases cover sidebar download recovery at two widths, compact-menu clipping, an unconfirmed outbox submission, offline initial-roster readiness, native titlebar focus, account-footer retries, embedded offline navigation, sidebar transport/client replacement, offline rename, and retained My sessions. The current native-titlebar failure is line 465; the old line 351 failure belongs to earlier code. Fourteen relevant test, support, status, menu, and CSS blobs are identical across scheduled main d5621d908488, the actual CI parent d0a12b23c08a, and tested merge 23eb089a55ce. Failed CI is retained as failed; these comparisons do not claim a fix for the baseline failures.

Use lazy, Loading, and Errored for System busyness imports and independent section presentation while retaining request authority, cancellation, replay, and polling history. Cover both initial and settled polling independence, including deferred status samples while active-run data stays pending.
@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.

@steipete
steipete marked this pull request as ready for review October 21, 2026 17:34
@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-22T07:34:16.186712Z 9354dfc 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@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: ⏳ 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. clawsweeper:intake:needs-repro 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 manual System busyness loading and error presentation with Solid native async boundaries.

Example: An active-run request remains pending while CPU samples update from 0.20 to 0.40 cores.

  • Before: Manual section-state records independently present the diagnostics results.
  • After: Independent native async boundaries preserve CPU updates and history while the active-run request remains pending.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent native-boundary refactor with inspected browser evidence, useful behavioral coverage, and no identified introduced defect; integration remains blocked by a verified conflict.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected production-build screenshots demonstrate expanded and compact loading parity; the exact-head body records browser polling through deferred responses and closing during Retry reachability checks, using synthetic fixtures without claiming a live Gateway or provider run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: System busyness must retain useful independent diagnostics and recoverable loading states during the Solid migration.
Reason: The maintainer-directed change follows the native Solid presentation contract without adding configuration, public APIs, or a competing diagnostics owner.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed refactor contains useful section-level async presentation work absent from current main, with no definite introduced correctness bug found.

Priority: P3
Reviewed head: d37a184b4bf3594df727b07e3f433aaf66e7201e

Before merge

Findings

None.

Agent review details

How this fits together

The Control UI overlay loads diagnostics through existing Gateway request owners and renders expanded sections or compact vitals; connection lifetime, permissions, cancellation, and polling remain synchronous.

flowchart TD
  A[System busyness controls] --> B[Overlay and lazy boundary]
  B --> C[Diagnostics polling owner]
  C --> D[Gateway request owners]
  D --> E[Section promises]
  E --> F[Independent async boundaries]
  F --> G[Sections and compact vitals]
Loading

Technical review

Best possible solution:

Integrate the section boundaries and retry presentation with main’s existing lazy loader while preserving independent polling, connection retirement, and dismissal checks.

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

This PR claims a refactor rather than a broken user contract; source inspection confirms the manual presentation it replaces.

Is this the best way to solve the issue?

Native boundaries fit the repository’s Solid contract, and the synchronous diagnostics owner remains responsible for permissions, cancellation, polling, and history.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Diagnostics section presentation keeps the original intent (d64ce70: The Solid migration preserved existing Gateway contracts and explicit request/subscription lifetimes.)
  • Overlay request and reconciliation lifecycle keeps the original intent (refactor(ui): simplify Debug overlay ownership #173866: Simplify presentation ownership while retaining synchronous request identity, connection custody, polling, and stale-chunk recovery; later property receipts preserve retirement ordering.)
  • Existing test consolidation keeps the original intent (test(core,plugins,ui): remove low-value tests (batch d374) #179283: Remove redundant test coverage while retaining distinct observable contracts; the new case protects settled revalidation rather than duplicating initial loading.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +39, Tests +28. Total +67 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 202 163 +39
Tests 1 28 0 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 230 163 +67

Review metrics

Metric Value Why it matters
Production versus test growth Production +39 lines; tests +28 lines The growth supplies independent pending/error frames, shared status reads, explicit retry presentation, and a distinct settled-polling contract without introducing another request owner.

Labels

Label changes:

  • add P3: This is a behavior-preserving UI refactor with no established current user-facing 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 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a behavior-preserving UI refactor with no established current user-facing defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 21, 2026, 4:25 PM ET / 20:25 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #180409, which preserves the reviewed Debug contribution at 9354dfc3c1780c6b45010d9cf260901f95588c52 and uses the current native landing workflow. Closing this duplicate-head submission so the canonical replacement can receive dependency and security checks. Retained native review state and receipts are preserved.

@steipete steipete closed this Oct 22, 2026
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: M 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