Skip to content

fix(editor): keep the OK button inside the rejected-uploads toast#1410

Open
dawsontoth wants to merge 1 commit into
stagefrom
fix/rejected-uploads-toast-ok-button-1323
Open

fix(editor): keep the OK button inside the rejected-uploads toast#1410
dawsontoth wants to merge 1 commit into
stagefrom
fix/rejected-uploads-toast-ok-button-1323

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

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 to flex-shrink: 0. The upload toasts in DropTarget.tsx set descriptionClassName: 'whitespace-pre', and white-space: pre forbids 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-line instead of whitespace-pre on 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-line keeps the intentional newlines between rejected files but lets long lines wrap; sonner already applies overflow-wrap: anywhere to 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):

  • Before (whitespace-pre): OK button overflows the toast by 42px — matches the screenshot in the issue.
  • After (whitespace-pre-line): messages wrap; the OK button sits fully inside the toast (17px of padding to spare).
Before After
Button pushed outside the toast (clipped at viewport edge) Text wraps, button inside

Full test suite (1036 tests), oxlint, dprint, and tsc -b all pass.

🤖 Generated with Claude Code

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>
@dawsontoth dawsontoth requested a review from a team as a code owner July 2, 2026 20:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Ok' button on Rejected uploads toast error message goes outside of container

1 participant