Skip to content

refactor(ui): use Solid actions for detail file operations - #179908

Merged
steipete merged 10 commits into
mainfrom
solid2/w-s2-chat-d-external-actions
Oct 22, 2026
Merged

steipete merged 10 commits into
mainfrom
solid2/w-s2-chat-d-external-actions

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Family Files Production LOC I1 I2 raw I3 I4 I5 I6 I7 raw I8 I9 I10 raw
attachments 34 4218 → 4225 0 4 2 1 → 0 0 0 0 0 0 0
automations 7 1514 0 0 2 1 0 0 0 0 0 0
cards 10 2148 0 0 0 2 0 1 0 0 0 0
context 2 542 0 1 0 0 0 0 0 0 0 0
details 18 4828 0 0 0 0 0 1 0 0 0 0
header-navigation 12 4139 0 0 0 0 0 1 0 0 0 0
indicators-other 65 7831 0 1 1 0 0 0 0 0 0 3
media_previews 23 3656 0 5 2 1 0 1 0 0 0 0
panels_files_sidebar 23 → 24 6045 → 6199 0 2 1 4 → 2 0 1 0 0 0 0
publication 3 843 0 0 0 0 0 0 0 0 0 0
pull_request_ci 9 2256 0 0 1 2 0 0 0 0 0 0
questions 13 2529 0 0 0 0 0 0 0 0 0 0
review_diff 17 3958 0 0 2 0 0 1 0 0 0 0
sharing 6 1955 0 0 0 0 0 0 0 0 0 0
sidebar 10 3383 0 0 0 1 0 0 0 0 0 0
source_previews 1 144 0 1 0 0 0 0 0 0 0 0
tools 7 1552 0 0 0 0 0 0 0 0 0 0
workspace 15 4738 0 0 4 0 0 1 0 0 0 0

Whole CHAT-D scope: 52a8f83b2d77 → a9cf671fa01d; 275 → 276 production files, 56,279 → 56,440 LOC. I1–I10 follow wave-ten. Raw API sites include documented computation cleanup and foreign-DOM exceptions; unlanded work remains counted.

Totals I1–I10: 0, 14, 15, 12 → 9, 0, 7, 0, 0, 0, 3.

What Problem This Solves

The detail panel kept separate pending presentation state for downloads, attachment transfers, and editor operations. A transfer could retain an old panel's transition when the native host changed its content or composer destination. Immediate disconnect retirement also interrupted a same-turn panel move that the Solid bridge deliberately preserves.

User Impact

Existing downloads, attachment transfers, and editor controls retain their behavior. Content replacement cannot publish a stale transfer, and moving a panel within the same turn preserves its work.

Why This Change Was Made

Use native Solid actions and optimistic process values for the already-admitted operations. Downloads and editor saves share a small presentation-lifetime helper. Native content/connection changes retire presentation synchronously. Attachment transfers also abort and release their composer read reservation when source, destination, or availability changes; stale bytes cannot enter the replacement composer. Disconnect retirement follows the bridge's microtask connectivity check, preserving a same-turn move.

Plain owners still admit writes, retain drafts, record failures/conflicts, and veto closing a saving editor. Retiring presentation does not cancel an admitted save. The synchronous saving bit remains for admission and the dirty-editor close veto. No extra reconciliation RPC, dependency, tag, class, selector, route, or lazy boundary changes.

Evidence

Proof Result
Current source Head a9cf671fa01d is a real merge of main 52a8f83b2d77; all nine patch files are byte-identical to reviewed 76a399095e5e.
Frozen install and UI types Passed on a9cf671fa01d, using pinned rc.16 and default tsrs.
Retained focused tests Five download, 19 attachment-transfer, 21 combined attachment-fixture, and 19 Chromium editor cases pass on identical patch sources. Reparent/content/destination retirement regression coverage is retained.
Independent review Fresh P0–P2 review against main52: scoped-clean; diff check passes.
Production Knip Final-head production scan passes; no ignores added.
Paired build and strict budget Node24.22, main52→head: startup 325088→325076 B (−12), 9 JS; CSS 40828 B / 1 request, unchanged. Chat 1441791→1441757 B (−34), new 1019498→1019463 B (−35); strict check passes. Startup is above the 325000 B campaign target on the base, and this change adds no bytes.
Visual proof Four inspected synthetic before/after captures preserve saving/completed editor states.
Full UI CI Exact-head run 39707493394 completed; all checks pass except sidebar reorder and its aggregate gate. The identical test and assertion fail on latest completed scheduled main 39707038848.

Production LOC: 1560→1721 (+161); directly coupled tests: 701→1117 (+416). Growth preserves synchronous admission, native scope retirement and stale-transfer rejection while sharing action presentation. The census now includes the independently found FileDownloadButton pending candidate; that separate follow-up remains counted here.

The earlier head failed only the shared header readiness test. The refreshed head incorporates main's menu scheduling fix. Native preparation passed for this head and the auto-merge request was accepted; subsequent observation races left that same request intact. The exact sidebar failure is now attributed against scheduled main39707038848. Native cancellation followed by same-head inherited-failure recovery preserves the reviewed head and its evidence.

Before: editor save pending (synthetic fixture)

Before: editor save complete (synthetic fixture)

After: editor save pending (synthetic fixture)

After: editor save complete (synthetic fixture)

Keep synchronous request admission and live-scope checks in the existing
attachment download owner. Use a Solid action and optimistic process flag
for pending presentation, retiring it before native content/runtime
replacement or disconnection so an abort-ignoring transport cannot hold
replacement rendering.

Preserve file navigation, editor drafts, retry errors, and actual blob
admission. The directly coupled operation-lifetime hook also supports the
editor follow-up without copying content or runtime state.
@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-22T02:21:54.500512Z a9cf671 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:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed 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 real behavior proof before merge.

What this changes

This PR uses Solid actions to present file operations and synchronously retires transfers when their source, destination, or availability changes.

Example: Attach notes.md, then switch from agent:main:first to agent:main:replacement while its read is pending.

  • Before: The old transfer can retain presentation state until reactive cleanup runs.
  • After: The native property change aborts the transfer and releases its pending-read reservation before publishing the replacement.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation preserves established owners and has focused regression coverage, but the supplied screenshots do not settle the changed authority boundary.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: A pending file operation can retain the old panel's presentation while the host changes content or composer destination.
Reason: The maintainer-directed refactor preserves existing capabilities and addresses a concrete lifetime boundary without adding settings or public APIs.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR open: it is a useful maintainer-directed lifecycle refactor, with no discrete introduced defect found; GitHub reports a conflict on the reviewed head.

Priority: P2
Reviewed head: 3d7e82a9e1c91efdfa4c3f070c6dd414ff367544

Before merge

  • Add real behavior proof - Authority-chain proof required: the inspected synthetic Control UI screenshots establish editor saving states, while the reported tests exercise held reads and cancellation; supply a redacted production-path trace showing notes.md reaching its authorized composer, then destination reassignment and source-authority revocation preventing late bytes from reaching final publication even when the read ignores abort. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - No concrete security regression was found, but the changed cross-session transfer boundary needs final-effect evidence.
  • Resolve merge risk - Confirm that the changed transfer-retirement boundary prevents stale session or revoked source authority from reaching final composer publication.
  • Complete next step - Resolve the reported merge conflict while preserving current main's settled cleanup lifecycle.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied material does not demonstrate allowed and revoked or reassigned transfers through final composer publication, and does not show the retirement regressions failing on the base.
Agent review details

How this fits together

The Control UI detail panel reads authorized file bytes, delegates attachment admission to the composer, and presents download and editor-operation progress without owning write authority.

flowchart LR
  A[File toolbar] --> B[Detail panel]
  B --> C[File read owner]
  C --> D[Attachment admission]
  D --> E[Composer draft]
  B --> F[Solid action presentation]
  G[Native scope changes] --> F
  G --> C
Loading

Technical review

Best possible solution:

Keep synchronous admission and final scope checks with the existing owners, while sharing only the retireable Solid presentation lifetime.

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

Source and focused deferred-read cases identify the native-property-to-reactive-publication interval; this read-only review did not execute the reproduction.

Is this the best way to solve the issue?

The shared presentation helper follows the repository's action recipe and leaves admission, draft retention, save settlement, and attachment processing with their existing owners.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Verify final transfer effects (recommended)
    Provide a production-path trace showing an allowed attachment reaching its intended composer and a held transfer rejected after destination replacement or authority revocation.

Provenance checked

Testing

Proof path: shipped entry point.

Security

Needs attention: No concrete security regression was found, but the changed cross-session transfer boundary needs final-effect evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 242fa52 adds ui/src/pages/chat/components/chat-attachment-download.ts:14 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 242fa5233273; files: ui/src/pages/chat/components/chat-attachment-download.ts)

PR surface

Source +157, Tests +336. Total +493 across 9 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 5 347 190 +157
Tests 4 343 7 +336
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 690 197 +493

Review metrics

Metric Value Why it matters
Production versus test growth Production +157 net lines; tests +336 net lines. The production growth supplies synchronous native retirement and shared action presentation; the tests cover cancellation, replacement isolation, retry, and editor-save continuity.

Labels

Label changes:

  • add P2: The change addresses bounded file-panel lifecycle behavior without evidence of a widespread runtime outage.
  • add merge-risk: 🚨 security-boundary: The changed transfer identity and retirement checks determine whether asynchronously obtained file bytes may enter a session composer.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: The change addresses bounded file-panel lifecycle behavior without evidence of a widespread runtime outage.
  • merge-risk: 🚨 security-boundary: The changed transfer identity and retirement checks determine whether asynchronously obtained file bytes may enter a session composer.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof for the replacement composer and revoked source authority, showing rejection before attachment publication.

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:31 PM ET / 21:31 UTC.

@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: 34d87119ab

ℹ️ 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 +100 to +102
a.getAttachments === b.getAttachments &&
a.onAttachmentsChange === b.onAttachmentsChange &&
a.onPendingReadsChange === b.onPendingReadsChange &&

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.

P1 Badge Key transfers by the stable destination owner

In the regular chat path, chat-state-controller.ts:163-185 recreates getAttachments, onAttachmentsChange, and onPendingReadsChange on every render. Starting a transfer invokes onPendingReadsChange(1), whose ChatAttachmentReadLifecycle.updatePending() publishes another render; these reference comparisons then make the native property callback retire and abort the request it just started, or make current() reject its result. Consequently, non-immediate Attach to session reads from file or Markdown previews can silently never reach the composer. Key the request by the stable destination owner and scope, such as attachmentReads, session, and client, rather than these ephemeral callbacks.

AGENTS.md reference: ui/AGENTS.md:L16-L18

Useful? React with 👍 / 👎.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 01:58
@steipete
steipete disabled auto-merge October 22, 2026 02:08
@steipete
steipete merged commit 7d5f4cd into main Oct 22, 2026
99 of 105 checks passed
@steipete
steipete deleted the solid2/w-s2-chat-d-external-actions branch October 22, 2026 02:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…179908)

* refactor(ui): observe attachment downloads with native actions

Keep synchronous request admission and live-scope checks in the existing
attachment download owner. Use a Solid action and optimistic process flag
for pending presentation, retiring it before native content/runtime
replacement or disconnection so an abort-ignoring transport cannot hold
replacement rendering.

Preserve file navigation, editor drafts, retry errors, and actual blob
admission. The directly coupled operation-lifetime hook also supports the
editor follow-up without copying content or runtime state.

* refactor(ui): present detail file operations with Solid actions

* test(ui): align attachment retirement fixtures with download contracts

* fix(ui): keep detail transfers alive while reparenting

* test(ui): await retained panel disconnect retirement
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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant