Repository navigation
Conversation
kalvinnchau
reviewed
Nov 9, 2026
kalvinnchau
left a comment
Contributor
There was a problem hiding this comment.
🤖 One preparation-error recovery regression found.
matt2e
force-pushed
the
errors/user-copy-messages
branch
from
November 9, 2026 16:06
4b2e055 to
32c31dc
Compare
matt2e
force-pushed
the
errors/upload-tile
branch
from
November 9, 2026 16:06
9f4219b to
e34a270
Compare
…d Send A failed attachment upload showed the Error's own message, such as "Failed to fetch" or "signal timed out". attachment-draft.ts now maps it by type with userCopy's failureKind: - UploadError keeps its message, which is already written for people - a lost connection: "Upload didn’t finish. Check your connection, then retry." - the five-minute timeout: "Upload took too long. Retry, or remove this file." - anything else: "Upload failed. Retry or remove this file.", now the one fallback shared with ComposerAttachments (which said "Upload failed. Retry or remove it to send.") While a failed upload blocks it, Send stays focusable (aria-disabled) with the tooltip "Retry or remove the failed file to send.", and Send and Enter still send nothing. The failed tile keeps Retry, then Remove, as on base. The error and the actions each take a full row from the tile's inner edge; the error sits 12px below the file row and the actions 12px below the error, 8px apart. The actions never wrap: the tile's min-content width keeps room for both, so a strip too narrow for them scrolls instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: mtoohey <mtoohey@squareup.com>
Choosing an image over 25 million pixels showed "Upload failed. Retry or remove this file." instead of why. prepareAttachment threw plain Errors for its own refusals, and the tile's mapper words any unknown error generically. prepare-attachment.ts now throws a PreparationError for the three refusals it writes for people: the pixel limit, no canvas context, and an image format the browser cannot prepare. The draft shows that message as it does an UploadError's. Every other failure, including an image the browser cannot decode, a canvas that yields no blob, and the WebP worker's own text, keeps the generic copy. A draft-level test runs the real preparation with a stubbed bitmap and canvas context. On the previous commit it fails for the pixel limit and the missing context; it also pins a decode error to the generic text. Signed-off-by: mtoohey <mtoohey@squareup.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matt2e
force-pushed
the
errors/user-copy-messages
branch
from
November 12, 2026 23:50
32c31dc to
0e35fbc
Compare
matt2e
force-pushed
the
errors/upload-tile
branch
from
November 12, 2026 23:50
82e6257 to
8f05fbe
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A failed attachment upload showed the browser's own text in the tile ("Failed to fetch", "signal timed out"), and a blocked Send gave no reason. Upload failures now map to plain copy through the shared helper. Send explains why it is blocked, and the failed tile's spacing is tidied.
Stacked on #3096: this PR targets
errors/user-copy-messages(PR #3096), which adds the shareduserCopy/failureKindhelper used here. Review and merge #3096 first.What changed
Upload failure copy (
attachment-draft.ts,ComposerAttachments.tsx)TypeError)Failed to fetchUpload didn’t finish. Check your connection, then retry.TimeoutError)signal timed outUpload took too long. Retry, or remove this file.Error's own messageUpload failed. Retry or remove this file.Upload failed. Retry or remove it to send.Upload failed. Retry or remove this file.(one shared fallback)UploadErrorBlocked Send (
MessageComposer.tsx)disabled, with no tooltip.aria-disabled="true") with the tooltipRetry or remove the failed file to send.Clicking Send or pressing Enter still sends, publishes and uploads nothing.Failed tile layout (
ComposerAttachments.module.css)Before / After
Final tile at 1280px:
Failed to fetchbecomesUpload didn’t finish. Check your connection, then retry.The error spans the tile and sits 12px from the file row and from the buttons. Retry still comes before Remove, as on base.Hovering Send while the failed file blocks it: the tooltip explains why Send does nothing. Older capture (round 3): the tile there shows Remove before Retry and the earlier spacing. The shipped tile is Retry, then Remove, as in the first image.
An upload that hits its timeout: the
DOMException'ssignal timed outbecomesUpload took too long. Retry, or remove this file.Older capture (round 1): the copy is current, but the tile spacing predates the final layout.Checks
pnpm typecheck: clean on this branch (on top of fix(errors): plain copy for failed history reads and connections #3096).pnpm lint: exit 0, with 30 infos that predate this change.biome formatis clean on the changed files.tests/browser/composer-attachments.spec.mjsare included but not run on this snapshot. On the source branch, a separate browser capture at 1280px measured the final tile: 12px file row to error, 12px error to buttons, and Retry and Remove sharing a top.Known gaps
🤖 Generated with Claude Code