Skip to content

refactor(ui): use native async file preview boundaries - #180480

Merged
steipete merged 6 commits into
mainfrom
solid2/pages-c-preview-current
Oct 22, 2026
Merged

steipete merged 6 commits into
mainfrom
solid2/pages-c-preview-current

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Solid 2 checklist (touched production files)

Item Before → after
1. Conditional intrinsic handlers 0 → 0
2. Component/factory teardown via onCleanup 1 → 0; raw onCleanup 2 → 1, onSettled 2 → 3
3. Persistent preview status fields / Promise-returning read memos 8 → 0 / 3 → 6; Loading and Errored each 1 → 2
4. action / createOptimistic 1 / 1 → 1 / 1; existing Claws mutation presentation unchanged
5. Manual dynamic-import loaders / lazy 0 / 0 → 0 / 0
6. Collection signals / stores / projections / reconciliation 0 → 0
7. Manual createComponent calls 0 → 0
8. Throw-only context wrappers 0 → 0
9. Direct sibling Loading / Reveal 0 / 0 → 0 / 0; one independent inventory/document region pair added
10. createRoot / getOwner / runWithOwner 0 / 0 / 0 → 0 / 0 / 0

The remaining onCleanup belongs to per-node target tracking. The two pending regions intentionally reveal independently: known inventory stays useful while a document loads. The per-file active bit records owner admission/deduplication, not UI loading state. Production LOC across five path entries: 1,434 → 1,457 (+23). Test LOC across five path entries, including a rename: 1,615 → 1,783 (+168).

Problem and change

Plugin skill previews and Claws file previews kept loading/error fields beside their requests. Error and retry replaced the modal shell and file rows. This change feeds stable request accessors into Solid's native async boundaries, preserving the mounted dialog shell and file inventory while the selected document loads or fails. Relative Markdown links, retry, foreground selection, and background completion retain their existing behavior.

The plain TypeScript owners retain request admission, source/version validation, deduplication, accepted content, and stale-result checks. Inventory and selected-document completion receipts are released on close, replacement, and disposal even when the transport is still pending. A regression test closes a held Claws preview, awaits its public readiness receipt, reopens, and confirms the old response cannot replace the new content. Retry and relative links keep their existing events. Both callers use the component returned by the bridge; the redundant registration wrapper and raw-element declaration are removed. Tags, classes, routes, and lazy boundaries stay intact.

Supersedes #179732 after integrating current main. No dependencies changed.

Proof

Current integrated base: e4798b27c759682499a23ce94127af4fa59af524. Head: 300a11807df1f24972d382afeffd2bca43ea0b7d. The one Catalog merge conflict kept Preview cancellation and removed the retired search timer; no other authored changes.

Check Result
Frozen install; default tsrs UI typecheck Pass
Direct plugin preview tests 11/11 passing proof retained; source/test blobs unchanged
Direct modal tests 14/14 passing proof retained; source/test blobs unchanged
Direct Claws tests Current 31/31 pass, including Catalog admission, retirement and stale replacement coverage
Scoped typed lint, formatting, controller guard Original passing proof retained; current typecheck and diff check pass
Independent Codex review Complete, scoped-clean P0–P2 review; final source snapshot verified
Paired production builds and strict performance Both passed; identical packaged plugin fingerprints and emitted plugin-ID inventory
Startup JS gzip / CSS 316,732 → 316,726 B (-6); CSS 40,894 B and 1 request unchanged
Chat / New Session JS gzip 1,438,854 → 1,438,860 B (+6); 1,015,904 → 1,015,895 B (-9); strict checks passed
Production Knip Same 13 unused heartbeat files on exact base and head; byte-identical output, no new ignores
Built-app synthetic captures Five before/after states at 1174×1100; every full frame inspected, synthetic only; all five pairs byte-identical
Full UI/Gateway CI Run 39757794212 attempt 2 passed: all 14 UI/Gateway jobs; first-attempt Details timeout and passing exact head/base replays retained below. No inherited-failure waiver.

The built-app capture verifies initial inventory loading, selected-file failure and Retry, Claws instruction loading, held relative-link navigation, retired reply isolation, scroll 300 → 300 after sibling completion, and reconnect close/reopen. The modal shell retains identity through failure/Retry; the baseline replaces it. Individual file row identity and trigger-focus restoration are unchanged and are not claimed by this refactor. One initial baseline capture stopped because its script incorrectly required the new shell-retention behavior on the base; it was corrected to measure that behavior independently, then both sides passed.

Node was used only for the standalone Playwright capture; unit tests used pinned Bun. Application chunk hashes differ with the source changes; package fingerprint equality and emitted plugin IDs are distinct checks. Full assigned-scope AST totals will be reported after the remaining family merges; these counts cover this complete Preview family.

The first CI attempt timed out in chat-details-panel-navigation.e2e.test.ts > opens Files from View all and dismisses Details in Chat and Dashboard while waiting for the workspace side panel. That exact case passed once on this head and once on base e4798b27c759; the tested merge has identical Chat/App/test source to this head. The timeout diagnostic showed a healthy connected renderer. No causal source defect was established, so the original failure remains recorded and one supported failed-job retry passed without changing the head. Passing replays do not establish an inherited failure.

Screenshots

Five pairs below were captured on dfc65ff / 5b536963. They remain valid for the unchanged Preview rendering: modal and Skill Preview blobs are byte-identical on the integrated head, and all six Claws Preview excerpts match. Current combined behavior is additionally covered by 31 Claws tests. These are retained captures, not new integrated-head screenshots.

before-plugin-first-open-held

before-plugin-selected-error

before-plugin-retry-held

before-claws-instruction-held

before-plugin-selected-held

after-plugin-first-open-held

after-plugin-selected-error

after-plugin-retry-held

after-claws-instruction-held

after-plugin-selected-held
Merged as 361a5ec92cc022a880e8aaac905a4d1e31d62348. All ten changed paths (including two deletions) match the reviewed head and verified main revision. Native merge reconciliation confirms the exact head; the SSD checkout is retained for coordinator cleanup.

Observe pending preview receipts through stable accessors so bridge prop batching
cannot hide a new file read behind previously settled content. Keep keyed render
callback arity explicit and compare boxed keys by receipt identity, preserving
foreground content and scroll while sibling responses finish.

Extend the selected-file retry regression to start from rendered Markdown and
follow its relative link while the selected reply is held.
Integrate the official Gateway retry animation fix for the failing 140 percent text-scale case. The nine-file preview patch remains byte-identical to its reviewed form; no conflict resolution or preview logic changes were needed.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 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 22, 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-22T09:48:53.752596Z 300a118 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. 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 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves plugin and Claws file previews onto native Solid async boundaries while retaining the dialog shell and file inventory.

Example: Opening references/config.md fails, then the user clicks Retry.

  • Before: Error and retry presentation can replace the plugin preview modal shell.
  • After: The same shell remains mounted while the document region shows the error or loading skeleton.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent ownership refactor with meaningful lifecycle coverage and inspected browser evidence; no actionable introduced defect was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR records exact-base/head built-app browser exercises of both preview callers, including held reads, failure/retry, relative navigation, retirement, reconnect, shell retention, and scroll preservation; all five screenshot pairs were directly inspected.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Loading, failure, and retry can replace the preview dialog shell instead of retaining a stable reading surface.
Reason: The maintainer-directed change follows the repository's native Solid ownership direction and preserves existing navigation, request validation, and retry contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor preserves preview ownership and has useful browser evidence; no introduced correctness or security defect was found, but required CI remains unresolved.

Priority: P3
Reviewed head: 5b5369630322fb19547f2a61fd53ddfe742aacd3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Plugin and Claws owners admit Gateway reads and retain accepted content; the shared file-preview modal consumes their completion receipts and renders inventory, documents, errors, and retry controls.

flowchart LR
  A[User selects a file] --> B[Existing preview owner]
  B --> C[Gateway read]
  C --> B
  B --> D[Request receipts and accepted content]
  D --> E[Solid async boundaries]
  E --> F[Retained preview dialog]
Loading

Technical review

Best possible solution:

Retain the shared native async boundaries and existing request owners, then land once required CI failures are resolved or properly attributed.

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

The base's separate loading/error frames explain shell replacement, and submitted built-app captures exercise the affected states; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The defect is presentation lifetime coupled to read status; the invariant is that loading, errors, and background completion preserve the shell while existing owners control admission and accepted content, and the diff implements that cutover without a competing owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared viewer rendering and retained content keeps the original intent (6d01bf5: The shared-viewer Solid migration preserved tags, keyboard controls, file browsing, and owner-scoped lifetimes; later retained-content work protected document identity and scroll.)
  • Lazy plugin bundle reads and request admission keeps the original intent (3aa130d: Show the entry before supporting downloads finish, retain usable inventory, deduplicate reads, and reject stale or mismatched results.)
  • Plugin readiness presentation keeps the original intent (f331169: Observe admitted initial reads through native async computation while retaining synchronous per-file admission and immediate retirement.)
  • Claws workspace-file previews keeps the original intent (f469f6d: Expose published Claw contents through the shared read-only viewer before adding an agent.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Verified introduced patch: Reviewed the pinned merge-base-to-head hunks, including receipt retirement, native loading/error regions, both callers, registration removal, and test changes. (5b5369630322)
  • Current-main behavior: Fetched main retains the base implementations of the shared modal and both preview owners; this PR's native-boundary cutover is still distinct work. (ui/src/components/file-preview-modal.tsx, ee3f29e2cf9e)
  • Owner invariants preserved: The existing plugin owner still deduplicates admitted reads, validates version/root identity, merges only the requested body, and rejects stale publication; retirement now releases selected-file receipts too. (ui/src/pages/plugins/skill-preview.tsx:112, 5b5369630322)
  • Inspected browser evidence: Inspected all ten attached images: five before/after pairs covering initial loading, selected-file failure, held retry, Claws instruction loading, and held selection. The PR records built-app shell-identity, retired-response, reconnect, and retained-scroll checks; screenshots directly establish the visible states. (5b5369630322)
  • Exact-head CI remains unresolved: The PR-context check rejects section headings despite substantive problem/proof content. The core test-types stripe failed during execution, but annotations expose only exit code 2; its log redirects to a blocked storage host, so neither PR causation nor an inherited failure is established. Several browser/Gateway checks remain running. (5b5369630322)
  • Feature history and superseded work: History across the earlier .ts paths identifies Patrick Erichsen's bundle/Claws work and Peter Steinberger's viewer and Solid ownership refactors. This PR explicitly supersedes refactor(ui): use native async file previews #179732; refactor(ui): derive plugin skill preview readiness #180120 explains the preceding readiness design. (ui/src/pages/plugins/skill-preview.tsx, ee3f29e2cf9e)

PR surface

Source +23, Tests +168. Total +191 across 10 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 266 243 +23
Tests 5 332 164 +168
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 598 407 +191

Review metrics

Metric Value Why it matters
Production versus test LOC Production +266/-243 (net +23); tests +332/-164 (net +168) Production growth supplies request receipts and independent native boundaries while removing status fields and registration machinery; tests add distinct retry, unavailable-file, and retirement coverage.

Root-cause cluster

Relationship: canonical
Canonical: #180480
Summary: This PR is the explicitly recorded replacement for the earlier native-preview refactor.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P3: A focused UI ownership refactor with preserved visible behavior and limited user-facing urgency.
  • 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 🦞 diamond lobster 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: A focused UI ownership refactor with preserved visible behavior and limited user-facing urgency.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • 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 22, 2026, 5:29 AM ET / 09:29 UTC.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 09:51
@steipete
steipete merged commit 361a5ec into main Oct 22, 2026
165 of 170 checks passed
@steipete
steipete deleted the solid2/pages-c-preview-current branch October 22, 2026 10:30
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
* refactor(ui): use native async file previews

* fix(ui): retain file preview boundaries by request identity

Observe pending preview receipts through stable accessors so bridge prop batching
cannot hide a new file read behind previously settled content. Keep keyed render
callback arity explicit and compare boxed keys by receipt identity, preserving
foreground content and scroll while sibling responses finish.

Extend the selected-file retry regression to start from rendered Markdown and
follow its relative link while the selected reply is held.

* test(ui): cover preview selection after unavailable entry
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