Repository navigation
refactor(ui): use Solid actions for detail file operations - #179908
Conversation
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.
…-s2-chat-d-external-actions
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs real behavior proof before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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
Technical reviewBest 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 optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No concrete security regression was found, but the changed cross-session transfer boundary needs final-effect evidence. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +157, Tests +336. Total +493 across 9 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 5:31 PM ET / 21:31 UTC. |
There was a problem hiding this comment.
💡 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".
| a.getAttachments === b.getAttachments && | ||
| a.onAttachmentsChange === b.onAttachmentsChange && | ||
| a.onPendingReadsChange === b.onPendingReadsChange && |
There was a problem hiding this comment.
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 👍 / 👎.
…-s2-chat-d-external-actions
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…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
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
a9cf671fa01dis a real merge of main52a8f83b2d77; all nine patch files are byte-identical to reviewed76a399095e5e.a9cf671fa01d, using pinned rc.16 and default tsrs.39707493394completed; all checks pass except sidebar reorder and its aggregate gate. The identical test and assertion fail on latest completed scheduled main39707038848.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.