Repository navigation
fix(ui): report attachment failures with an error toast - #178942
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 changes before merge. What this changesThis PR makes rejected attachment feedback appear immediately while the chat composer is idle. Example: Select the 2,048-byte holiday-photo.jpg with a 1,024-byte attachment limit and leave the composer empty.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this PR fixes a current composer publication regression with a focused change and convincing visual evidence; no actionable defects were found. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe attachment lifecycle owns rejected files and read progress; the chat state owner publishes changes through the existing composer source to the Solid attachment preview. flowchart LR
A[Native file input] --> B[Attachment admission]
B --> C[Attachment read lifecycle]
C --> D[Chat state publication filter]
D --> E[Composer source]
E --> F[Attachment preview and recovery controls]
Technical reviewBest possible solution: Publish lifecycle identity and revision changes through the existing composer source while retaining suppression of unrelated stream updates. Do we have a high-confidence way to reproduce the issue? Source establishes that an all-rejected selection changes lifecycle revision without changing any previously compared composer value; inspected before screenshots corroborate the reported failure. Is this the best way to solve the issue? The six-line production change repairs the missing publication dependency at its existing owner without restoring redraw callbacks or introducing another state owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 032922cd10ed. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +36. Total +42 across 2 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
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 20, 2026, 10:49 PM ET / October 21, 2026, 02:49 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Closes #178952
What Problem This Solves
Rejected files and failed attachment reads or video compression leave unusable cards and inline errors in the composer; compression failures can display the same error twice.
User Impact
Attachment failures show one short, dismissible error toast at the top center. Unusable files stay out of the composer, while draft text and valid attachments remain available. Size rejection says “File too large. Try a smaller file.”
Why This Change Was Made
Admission rejects oversized files before reading bytes. The attachment lifecycle removes failed reads and prepared files, releases their pending work, and reports the error once through the existing toast component. Its opt-in error severity uses the active theme’s danger colors for the surface, text, icon, and controls; other notifications retain their normal appearance. New Session retains the failed-read outcome so an earlier Send action cannot submit an incomplete prompt automatically. Accepted attachments keep their existing offer, progress, cancel, and ready states.
Evidence
Each pair uses the same file, fixture state, and viewport. Before shows neutral feedback; after uses the active theme’s error colors. Full frames show the toast position and the entire composer.
Size rejection
Read failure
Video compression failure
Additional theme coverage
Risk and coverage
The change covers attachment admission and failed read/preparation cleanup. File-size policy and successful/pending attachment presentation are unchanged. Tests include batch limits, cancellation, late replies, stalled reads, and preventing automatic submission after a failed read. Browser evidence uses a mocked Gateway and mobile viewports; no live Gateway or physical device was changed. The max-lines suppression guard reports three existing suppressions in unchanged files (
chat-message.test.tsx,config-page-state.ts, andsessions-page-state.ts); their contents match the base commit. The combined owner lint also identified one existing Solid reactivity warning outside the diff; the final severity delta has no lint warnings or errors.CI investigation
The six remaining attachment fixtures now assert the approved toast, copy, and error severity while preserving draft text, valid attachments, retry, cancellation, and the guard against automatic incomplete submission. They passed 48/48 in 4.27s; their independent P0–P2 review and targeted lint/format checks passed.
Hosted CI run 39549002933 completed for head
7d1b6852f5d2225040e4424360bf2eda8ac4ff99: 65 jobs passed. One existing dashboard test failed, and the aggregate CI gate failed downstream. The test timed out waiting for a secondboard.updaterequest after removing a widget (solo-widget-chrome.e2e.test.ts:237).One focused diagnostic replay passed with unchanged assertions and timeouts: 2.61s for the case, 13.84s including its bundle build. No repair was established, and a passing replay does not resolve the original failure. The removal-path source files match main; no matching failure on main was found. An independent attribution review found no defect attributable to the attachment diff and retained the unexplained cause. CI remains failed.
The scoped landing review attributes the remaining failure to the unchanged dashboard removal path: this scenario never admits or reads an attachment, and the eight inspected removal/test inputs are identical between the recorded main baseline and the actual CI merge. The supported unrelated-failure landing route retains this failed run and its unexplained cause; it does not claim a matching main failure or a successful CI run.