fix(editor): keep the OK button inside the rejected-uploads toast#1410
Open
dawsontoth wants to merge 1 commit into
Open
fix(editor): keep the OK button inside the rejected-uploads toast#1410dawsontoth wants to merge 1 commit into
dawsontoth wants to merge 1 commit into
Conversation
Sonner toasts are fixed-width flex rows (content + action button). The upload toasts set `whitespace-pre` on the description, so a long rejection message (e.g. the dotfile-skipped notice) could not wrap, widened the content column past the toast, and shoved the OK/Cancel button outside the container. Use `whitespace-pre-line` instead: the intentional newlines between rejected files are preserved, but long lines now wrap inside the toast (sonner already applies `overflow-wrap: anywhere`), keeping the action button in place. Fixes #1323 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the descriptionClassName in DropTarget.tsx from whitespace-pre to whitespace-pre-line for both loading and error toasts. This change prevents long, unwrappable lines from pushing the action button outside the fixed-width container of the sonner toasts. I have no feedback to provide.
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
Fixes #1323 — the OK button on the "Rejected uploads" toast rendered outside the toast container when dotfiles were rejected during a drag-and-drop upload into the cluster editor.
Root cause
Sonner toasts are fixed-width (356px) flex rows:
[icon] [content column] [action button], with the button set toflex-shrink: 0. The upload toasts inDropTarget.tsxsetdescriptionClassName: 'whitespace-pre', andwhite-space: preforbids all line wrapping. A rejection message longer than the toast (e.g. "Sensitive files and folders starting with . are skipped.") therefore widened the content column past the toast's fixed width and pushed the OK button out of the container.Fix
Use
whitespace-pre-lineinstead ofwhitespace-preon both upload toasts (the in-progress toast had the same latent bug — a long file name would push its Cancel button out the same way).pre-linekeeps the intentional newlines between rejected files but lets long lines wrap; sonner already appliesoverflow-wrap: anywhereto toast content, so even unbroken long file paths wrap cleanly.Verification
Reproduced the exact sonner DOM + stylesheet in an isolated page and measured with both classes (the real flow needs an authenticated cluster editor):
whitespace-pre): OK button overflows the toast by 42px — matches the screenshot in the issue.whitespace-pre-line): messages wrap; the OK button sits fully inside the toast (17px of padding to spare).Full test suite (1036 tests), oxlint, dprint, and
tsc -ball pass.🤖 Generated with Claude Code