Repository navigation
fix(desktop): let a toast slide one way only, right - #4248
Merged
Merged
Conversation
The card followed the pointer left, right and down, so a drag wobbled diagonally. It now slides right toward the window's edge, rubber-bands at a sixth any other way, and dismisses past 48px or on a quick flick right.
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.
What
Before this change, a toast followed the pointer left, right and down, so dragging it wobbled diagonally. Now it slides one way only, right toward the window's edge:
src/lib/toastDrag.tsholds the drag math,src/ui/Toaster.tsxpasses the drag duration for the flick, anddocs/design.mdis updated to match.Changelog
Toasts now swipe away to the right only, and a quick flick dismisses them.
Testing
bun run checkinapps/desktop(includes the updatedtoastDragunit tests).dragStateoutput to a toast for a diagonal drag (left and down) and for a drag right: the diagonal drag now barely moves the card, and the drag right follows the pointer.