Skip to content

fix(ui): a mouse drag dismisses a toast instead of selecting its text - #1792

Merged
backnotprop merged 2 commits into
backnotprop:mainfrom
h-jennings:fix/toast-drag-dismiss
Oct 8, 2026
Merged

backnotprop merged 2 commits into
backnotprop:mainfrom
h-jennings:fix/toast-drag-dismiss

Conversation

@h-jennings

@h-jennings h-jennings commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Why

Toasts are hard to dismiss with a mouse. Their text is selectable, and Sonner stops a swipe-to-dismiss as soon as any text on the page is selected, so pressing on a toast and dragging it highlights the text and leaves the toast where it is. The update notices ("A new version of Plannotator is available", "Updated to vX") are where this shows up most.

What changed

Both <Toaster>s (plan review / annotate in packages/editor/App.tsx, code review in packages/review-editor/App.tsx) now give every toast select-none through toastOptions.className. Sonner merges it with each toast's own classes, so existing per-toast styling is unchanged.

Before / after

Before: dragging the toast selects its text and it stays.

before.mp4

After: the same drag dismisses it.

after.mp4

Testing

  • bun run dev:review, open http://localhost:3001/?preview-update=9.9.9: the update toast appears after ~1.5s; a press-and-drag on its text dismisses it with nothing highlighted, and double-clicking the text selects nothing.
  • bun run dev:hook, open http://localhost:3000/?preview-update=9.9.9: same in plan review.

Notes

The "Auto-update failed" toast's log path can no longer be selected to copy.

Sonner aborts a swipe-to-dismiss once any text on the page is selected,
and toast text was selectable, so dragging a toast with the mouse (the
update notices in particular) highlighted it and left it on screen. Both
Toasters (plan/annotate and code review) now give every toast
select-none. The cost: the Auto-update failed toast's log path can no
longer be selected to copy.
@h-jennings
h-jennings marked this pull request as ready for review October 8, 2026 15:39
Every toast is select-none so a mouse drag dismisses it, but the
auto-update failure names the path of update.log, which is worth copying.
That one description line stays selectable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@backnotprop
backnotprop merged commit ef06a3f into backnotprop:main Oct 8, 2026
25 checks passed
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.

2 participants