Skip to content

refactor(ui): use native async file previews - #179732

Closed
steipete wants to merge 3 commits into
mainfrom
solid2/pages-c-preview-reads
Closed

steipete wants to merge 3 commits into
mainfrom
solid2/pages-c-preview-reads

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Plugin skill previews and Claws file previews maintained separate loading and error fields beside their request state. Move those reads onto Solid's native async boundaries while preserving the existing owner contracts, lazy route boundaries, host tag, selectors, cancellation, retry behavior, and retained file inventory.

User Impact

The inventory remains available while a selected file loads. Following a relative Markdown link from an already rendered entry now selects the requested file and shows its loading skeleton. Background file completion preserves the foreground document and scroll position.

Why This Change Was Made

The owners publish completion receipts; their existing admission, deduplication, source validation, accepted snapshots, and stale-result checks remain authoritative. Persistent read memos feed two independent <Loading> / <Errored> leaves in the shared modal. Stable request accessors allow those leaves to observe new requests while the bridge holds a pending prop update. Keyed request boundaries reset failed reads for Retry, while receipt equality preserves settled content when unrelated owner publications arrive. The dialog shell and inventory stay mounted. Both callers use the component returned by defineSolidBridge; the redundant registration wrapper and raw-element declaration are removed.

Evidence

Integrated base d84c03e3f52ece844b6fbc991f0a50fddeea63b9, final head fb6164bf1b186354f70d73331c11c489bd069234. ci:full requests every UI, browser-extension, and real-Gateway shard. Final-head CI remains the canonical suite proof.

Check Result
Integrated pnpm install --frozen-lockfile and pnpm tsgo:ui Pass
Final scoped type-aware lint, format, git diff --check Pass
Preview unit proof All 8 cases pass on exact integrated fb616 in CI run 39667833363 UI shard 1/3, including held relative-link loading, rejection/retry, deduplication and retirement. That shard separately fails the 30 sidebar cases described below.
File preview modal tests All 14 cases pass on exact integrated fb616 in CI run 39667833363 UI shard 3/3: keyboard, copy, focus, reconnect, large content, relative links and retained sibling scroll.
Coupled Claws preview case 1 passed on the original candidate; caller request props remain typechecked on the final head
Canonical preview browser proof All 6 cases passed on exact integrated fb616 in CI run 39667833363, job 119458209651: the 3 full-bundle routes, retry/navigation, retained foreground scroll and reconnect. Suite: 23,883 ms. The containing E2E shard 8/9 passed.
Focused built-app behavior on reviewed renderer Pass on 4543: selected config skeleton, 2 retained inventory rows, cached foreground entry retained after background completion, scroll 300 → 300, reconnect closes the viewer and reopening succeeds; no page or cleanup errors. Renderer blobs are unchanged by integration.
Earlier local browser setup failures Two scroll/reconnect Vitest attempts stopped at initial-roster readiness before preview assertions. Those attempts remain failed setup evidence; both exact cases subsequently passed canonical 4543 CI. The separate built-app capture uses the existing independent-route harness with initial-roster waiting disabled.
Production Knip Pass on exact fb616 (25m 22.3s); no ignores or baseline waiver.
Paired production builds and strict performance Original paired base 948f6bc3 → reviewed 4543: 324,945 → 324,973 B startup JS gzip (+28 B), raw 969,980 B unchanged, 8 JS / 1 CSS request. Exact integrated fb616 CI performance passes at 324,982 B gzip, 973,548 B raw, 9 JS / 1 CSS request; CSS 40,780 B gzip.
Isolated review and integration verification Scoped-clean original and repair reviews retained. All 9 scoped path blobs on both sides of the PR diff are identical after the conflict-free official-main merge; source hashes match reviewed/captured renderer files.

Current exact-head CI 39667833363 completed with 2 failed test jobs plus the aggregate gate. UI unit shard 1/3 has 30 app-sidebar-rail.test.ts failures from duplicate openclaw-modal-dialog registration. Latest completed scheduled main 39662150265 passes all UI unit shards, so these failures are unqualified and admission is held. E2E shard 6/9 fails only chat-responsive.e2e.test.ts > Chat responsive app behavior > renders one named card for every success and failure in a mixed attachment batch at the line-462 left-gap assertion; that exact test also fails on scheduled main.

The unit reporter places chat-state.test.ts immediately before the failing rail file in the same reused unit-worker slot; Preview tests run later. The lightbox fixture can leave a lazy import that registers openclaw-modal-dialog pending at teardown. The active #179576 change moves that fixture and waits for vi.dynamicImportSettled() after unmount; it is a named prerequisite under investigation, not an inherited-failure waiver. This branch will consume that repair through official main when available.

The old 4543 CI run completed with 31 successful jobs, 27 skipped and 7 failures (6 UI shards plus the aggregate gate). Its 12 failing case names were compared with completed scheduled main 39654415683: 11 names and primary errors matched; the Retry140 case passed that latest main and therefore received no older-main waiver. This branch merges official main, including the landed Retry140 fix (#179803 / 86f66e5d3200), to resolve that gap. No Preview code changed during the integration, and the PR diff remains confined to its original 9 paths. The current exact-head verdict and its held unit failure are recorded above.

Size and Solid 2 checklist

Production LOC across the five touched production paths: 1,367 → 1,412 (+45). This repair adds 11 production lines over the earlier head. The growth provides native boundary markup, completion receipts and stable request keys; redundant loading/error presentation fields, one registration wrapper and the element declaration are removed. Plugin preview test LOC: 148 → 243.

Checklist item (touched production files) Before → after
Unstable intrinsic handlers 0 → 0
Component-level onCleanup 2 → 1
Manual async read slots 4 → 1; preview-specific slots 3 → 0
Mutation action imports 0 → 0; no mutation flow changed
Manual lazy loaders 0 → 0
Object/array signals 0 → 0
Handwritten createComponent 0 → 0
Throw-only context wrappers 0 → 0
Native loading regions / Reveal 0 → 2; inventory and document intentionally independent
Feature owner APIs 0 → 0

The remaining Claws catalog read and disposal lifecycle belong to separate coordinated work. The modal's remaining onCleanup is tied to a reactive row registration. No effects, untrack, direct DOM listeners/queries, flush calls or feature owner APIs were added. Domain ownership, cancellation and mutation behavior remain unchanged.

Screenshots

The final repair pair shows the same deferred request after following the Configuration Markdown link. Before: the request is admitted but the previous entry remains selected and no skeleton appears. After: config.md is selected, one document skeleton appears, and the inventory remains available. Both full captures were inspected; synthetic data only.

State Before Final repair
Settled entry → held selected-file read Before: deferred file read leaves stale entry selected After: deferred selected file shows skeleton and retains inventory

The original four pairs below are byte-identical and retain the earlier candidate’s visual evidence. Each unique full capture was inspected, and every before/after file hash was verified. Synthetic data only.

State Before After
plugin-first-open-held Before: plugin-first-open-held After: plugin-first-open-held
plugin-selected-error Before: plugin-selected-error After: plugin-selected-error
plugin-retry-held Before: plugin-retry-held After: plugin-retry-held
claws-instruction-held Before: claws-instruction-held After: claws-instruction-held

@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-21T20:13:23.778141Z fb6164b 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
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.
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Oct 21, 2026
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb6164bf1b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +193 to +195
const fileRequest = () => {
const current = state();
return current?.fileRequests.get(current.activePath)?.promise ?? current?.inventoryRequest;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Key the detail boundary by the active path

When the initial inventory returns the entry file as unavailable, readFile throws and the modal's Errored boundary enters its fallback. If the user then selects a non-fetchable sibling such as a too-large file, fileRequest still returns the same inventory promise, so the keyed detail boundary is not remounted and remains stuck on the previous error instead of displaying the sibling's status message. Include the active path in this boundary identity so selection can clear an error even when no file-specific request is created.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:feature 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 preview loading and error fields with native Solid async boundaries for plugin skills and Claws files.

Example: Follow the Configuration link from SKILL.md to references/config.md while its read is pending.

  • Before: The earlier candidate retains SKILL.md as selected and displays its old contents.
  • After: config.md becomes selected and displays a document skeleton while the inventory remains available.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful owner-directed work with inspected behavior proof, one concrete navigation regression, and unresolved exact-head CI attribution.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected built-app before/after screenshots show relative-link selection advancing to config.md with a document skeleton and retained inventory; the initial-loading pair preserves presentation, and the body records background-scroll and reconnect results on unchanged renderer blobs.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: File previews must show the selected file's loading or error state while keeping the inventory and unrelated foreground content stable.
Reason: The maintainer-authored direction aligns with the native Solid migration and removes redundant presentation state without adding configuration or changing Gateway contracts.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: this owner-directed refactor has useful visual proof, but introduces a selected-file error recovery regression.

Priority: P2
Reviewed head: fb6164bf1b186354f70d73331c11c489bd069234

Before merge

  • Include the selected path in the detail boundary identity (P2) - If the inventory contains unavailable SKILL.md and a too-large or binary sibling, readFile throws for the entry and Errored displays its fallback. Selecting the sibling creates no individual request, so fileRequest still returns the inventory promise and this equality check keeps the same errored boundary mounted. The sibling's status never replaces the old error, and Retry cannot recover because selecting that non-fetchable sibling issues no read. Include the selected path in the keyed identity and add an unavailable-entry-to-sibling navigation regression.
  • Complete next step - Attribute the duplicate-modal sidebar failures before treating exact-head CI as acceptable; the cleanup candidate at refactor(ui): derive explicit model discovery status #179576 is not yet a verified explanation.

Findings

  • [P2] Include the selected path in the detail boundary identity — ui/src/components/file-preview-modal.tsx:99-101

Tests

  • Missing end-to-end proof: A red-on-base run of the added UI regressions is not recorded.
Agent review details

How this fits together

Plugin and Claws preview owners admit Gateway reads and retain accepted file contents; the shared modal consumes their completion receipts to display inventory, documents, loading states, and retry controls.

flowchart LR
  A[Preview selection] --> B[Plugin or Claws owner]
  B --> C[Gateway file read]
  C --> B
  B --> D[Accepted contents and receipts]
  D --> E[Solid async boundaries]
  E --> F[Inventory and document modal]
Loading

Technical review

Best possible solution:

Keep the native boundaries and key the detail leaf by selected path plus request identity, preserving it across unrelated completions.

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

Source establishes the failure: return unavailable SKILL.md and a too-large sibling in the inventory, then select that sibling; both selections retain the same promise identity, so the errored detail boundary is not reset.

Is this the best way to solve the issue?

Native async presentation follows the repository's Solid direction and retains existing request owners, but request identity alone is insufficient to preserve selection-specific error recovery.

Full review comments:

  • [P2] Include the selected path in the detail boundary identity — ui/src/components/file-preview-modal.tsx:99-101
    If the inventory contains unavailable SKILL.md and a too-large or binary sibling, readFile throws for the entry and Errored displays its fallback. Selecting the sibling creates no individual request, so fileRequest still returns the inventory promise and this equality check keeps the same errored boundary mounted. The sibling's status never replaces the old error, and Retry cannot recover because selecting that non-fetchable sibling issues no read. Include the selected path in the keyed identity and add an unavailable-entry-to-sibling navigation regression.
    Confidence: 0.98
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Lazy plugin bundle reads keeps the original intent (3aa130d: Show SKILL.md before supporting files finish, retain the inventory, reuse loaded bodies, and preserve retry and stale-response handling.)
  • Shared Solid viewer and native registration keeps the original intent (6d01bf5: Provide one Solid implementation while preserving native tags, selectors, keyboard controls, and ownership semantics.)
  • Retained document contents and scroll keeps the original intent (d17bdb4: Share sanitized rendering while retaining document content and scroll position across unrelated updates.)
  • Claws instruction and skill previews keeps the original intent (f469f6d: Expose published Claw contents before Add through the shared preview surface.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/plugins/skill-preview.test.tsx --maxWorkers=1
  • pnpm test ui/src/components/file-preview-modal.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

PR surface

Source +45, Tests +95. Total +140 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 240 195 +45
Tests 4 245 150 +95
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 485 345 +140

Review metrics

Metric Value Why it matters
Production versus test changes Production +240/-195, net +45; tests +245/-150, net +95. Production growth supplies independent async leaves and completion receipts while removing manual presentation fields; test growth exercises visible loading, retry, and lifecycle behavior.

Labels

Label changes:

  • add P2: The introduced error-boundary defect affects file-preview navigation after an unavailable entry, with limited scope and recoverable impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The introduced error-boundary defect affects file-preview navigation after an unavailable entry, with limited scope and recoverable impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • 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, 5:52 PM ET / 21:52 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #180480, merged as 361a5ec. The replacement contains the reviewed native async preview cutover and its final proof.

@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. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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