Repository navigation
fix: keep preparing Home attachments across page and dock switches - #157013
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 24, 2026, 12:54 AM ET / 04:54 UTC. ClawSweeper reviewWhat this changesThe Control UI moves an active file read with the Home draft between page and dock composers, preserving preparation status, Send gating, and the completed attachment. Merge readiness✅ Ready for maintainer review Keep open for normal landing review. Current main still loses an in-progress Home attachment during page and dock handoff; the branch has focused browser proof, and I found no blocking correctness or security defect. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI turns a locally selected file into a chat attachment while the browser reads it. The Home page and dock hand the same draft between composers, which then controls attachment display and whether Send is available. flowchart LR
A[Selected Home file] --> B[Browser file read]
B --> C[Composer read lifecycle]
C --> D[Scoped page or dock handoff]
D --> E[Active draft and progress]
B --> F[Completed attachment]
F --> E
E --> G[Send availability]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +58, Tests +207, Docs +2. Total +267 across 9 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one scope-checked read lifecycle with the active Home composer and retain browser coverage for navigation, removal, and completion. Do we have a high-confidence way to reproduce the issue? Yes. The contributor captured the failing browser route on original code, and current main still has that handoff path; this read-only review did not execute it locally. Is this the best way to solve the issue? Yes. Moving the existing read lifecycle with the scoped composer draft repairs the owner boundary without adding another attachment store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6a6f8a6ecec2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes attachments disappearing when you leave Home for another page and open the Home dock while a selected file is still being prepared.
User Impact
Your Home draft keeps the preparing file, its progress and Remove action across page/dock switches. Send waits for preparation, and the completed attachment remains available when you return Home.
Why This Change Was Made
The draft handoff moved completed attachments but left active file reads in the old composer. Transfer the existing read lifecycle with the draft and retarget its completion callbacks and render notifications to the current composer. The old controller receives an empty lifecycle, so disposing it cannot cancel the transferred read. Existing conversation/profile ownership checks remain authoritative.
Evidence
The actual browser route selects a synthetic text file, holds its native FileReader, navigates Home → Agents → Home dock, completes the read, and returns Home. On the original code the dock has no pending tile, Send is enabled, and the returned draft has no attachment. With the repair the pending tile and Send gate survive, followed by the completed file and its Remove action. No model/provider request is involved.
The first scoped lint run caught three older browser-fixture callbacks that did not return the new native-read completion Promise. Those callers now return it to their existing await; lint passed after correction. All nine selected handoff, rewind, paste and session-switch browser cases then passed in 23.02s grouped wall time (including the canonical UI production bundle).
Before/after screenshots below show both the dock during preparation and Home after file completion. All captures use synthetic data.