Skip to content

fix(ui): report attachment failures with an error toast - #178942

Merged
vyctorbrzezowski merged 4 commits into
mainfrom
brzezowski/composer-attachment-rejection
Oct 21, 2026
Merged

vyctorbrzezowski merged 4 commits into
mainfrom
brzezowski/composer-attachment-rejection

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

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

  • Real file-input checks cover size rejection, failed reads, and failed video compression on desktop and mobile. They preserve draft text, valid attachments, retry, accessibility, and top-center placement.
  • The nine error appearance cases failed on neutral colors before the repair and passed afterward: 9/9, 16.84s including canonical bundle setup. Claw light/dark meet 4.5:1 contrast; Beacon meets 7:1.
  • The canonical toast browser tests pass 12/12 (3.55s runner), including theme error colors on text/icon/controls and returning to neutral appearance after replacement.
  • Attachment/video/composer unit coverage remains green: 52/52 (4.80s runner), plus 3/3 cold-Send cases (1.73s). Focused lifecycle/read browser checks passed 4/4 (11.96s including setup); no repeated full suite was needed for the color change.
  • UI production types, affected test type graphs, focused lint/styles, and English catalog verification pass. Fresh independent review: no actionable P0–P2 findings. The final CI investigation is recorded below.

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

Desktop before Desktop after
Size rejection desktop before Size rejection desktop after
Mobile before Mobile after
Size rejection mobile before Size rejection mobile after

Read failure

Desktop before Desktop after
Read failure desktop before Read failure desktop after
Mobile before Mobile after
Read failure mobile before Read failure mobile after

Video compression failure

Desktop before Desktop after
Compression failure desktop before Compression failure desktop after
Mobile before Mobile after
Compression failure mobile before Compression failure mobile after

Additional theme coverage

Claw light before Claw light after
Claw light error toast before Claw light error toast after
Beacon before Beacon after
Beacon error toast before Beacon error toast after

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, and sessions-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 second board.update request 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.

@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.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 21, 2026 02:27
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as draft October 21, 2026 02:35
@clawsweeper clawsweeper Bot added 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. 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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. 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 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.

  • Before: A temporary toast appears, but the persistent failed-file tile and explanation remain hidden until another update.
  • After: The failed-file tile, removal control, and recovery guidance appear immediately and remain after the toast expires.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-level repair with directly inspected visual proof and meaningful regression coverage; draft status and the incomplete CI gate remain workflow considerations.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected desktop and mobile before/after screenshots exercise native file selection in Chromium and show persistent rejection feedback through the production composer renderer; the Gateway is mocked, and the body reports the paused-clock regression failing before and passing after the repair.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Rejected files can leave no lasting explanation beside an idle composer.
Reason: The maintainer-authored direction restores established persistent feedback with a narrow repair and preserves existing defaults.

Regression provenance

Regression provenance — verified: source commit 4a866b9de074 by Peter Steinberger; canonical PR #175721 (blame-to-merge-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
Reviewed head: 2d91f396b3721baa74e32386eb2d99ab9a42be7c

Before merge

  • Complete next step - Mark this PR ready for review when the draft hold is resolved.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Composer publication filtering keeps the original intent (4a866b9: Retire pane-wide redraw callbacks while publishing through domain owners and keeping ordinary typing composer-local.)
  • Persistent attachment rejection feedback keeps the original intent (f98de40: Keep rejected files and recovery guidance beside the composer until removal.)
  • Attachment browser regression keeps the original intent (fcdb4cd: Consolidate test fixtures while retaining distinct behavioral contracts; this PR strengthens the existing scenario against an idle-publication failure.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4ad6f7a adds ui/src/pages/chat/chat-state-controller.ts:66 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4ad6f7aee240; files: ui/src/pages/chat/chat-state-controller.ts)

PR surface

Source +6, Tests +36. Total +42 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 6 0 +6
Tests 1 69 33 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 75 33 +42

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +6/-0 lines; tests +69/-33 lines The production growth completes the existing invalidation key; test growth prevents clock advancement from masking the bug and exercises recovery.

Root-cause cluster

Relationship: same_root_cause
Canonical: #178952
Summary: This PR implements the publication repair requested by the linked issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Persistent rejection feedback is hidden in an otherwise usable composer, with a temporary notification and subsequent interaction providing recovery.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Persistent rejection feedback is hidden in an otherwise usable composer, with a temporary notification and subsequent interaction providing recovery.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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 20, 2026, 10:49 PM ET / October 21, 2026, 02:49 UTC.

@vyctorbrzezowski vyctorbrzezowski changed the title fix(ui): show rejected attachments while the composer is idle fix(ui): report attachment failures with a toast Oct 21, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 21, 2026 03:34
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as draft October 21, 2026 03:35
@vyctorbrzezowski vyctorbrzezowski changed the title fix(ui): report attachment failures with a toast fix(ui): report attachment failures with an error toast Oct 21, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 21, 2026 04:51
@vyctorbrzezowski
vyctorbrzezowski enabled auto-merge (squash) October 21, 2026 04:57
@vyctorbrzezowski
vyctorbrzezowski merged commit aeae6d1 into main Oct 21, 2026
104 of 107 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/composer-attachment-rejection branch October 21, 2026 06:28
@vyctorbrzezowski

Copy link
Copy Markdown
Member 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
)

* fix(ui): show rejected attachments while the composer is idle

* fix(ui): report attachment failures with a toast

* fix(ui): tint attachment error toasts with theme colors

* test(ui): align attachment failure expectations with toast feedback
@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 25, 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 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: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

Attachment failures leave unusable cards and duplicate errors in the composer

1 participant