Fix toast appearance and interaction behavior#934
Fix toast appearance and interaction behavior#934mitre88 wants to merge 1 commit intoAdamant-im:developfrom
Conversation
- Add swipe-up gesture to dismiss toasts - Add swipe-down gesture to expand truncated text - Show expand/collapse chevron only when text is truncated - Block tap pass-through with contentShape(Rectangle()) - Increase auto-dismiss timer from 3s to 4s Fixes Adamant-im#933 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8d01dd686
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| private let autoDismissTimeInterval: TimeInterval = 3 | ||
| private let autoDismissTimeInterval: TimeInterval = 4 |
There was a problem hiding this comment.
Keep alert/notification auto-dismiss interval unchanged
Changing autoDismissTimeInterval to 4 seconds affects more than toasts: dismissNotification() and dismissAlert() both call setTimer(...) and now wait an extra second as well. Since this commit is scoped to toast UX, this introduces an unintended behavior change for notifications/alerts unless those flows were explicitly meant to slow down too.
Useful? React with 👍 / 👎.
| } else if value.translation.height > 25 && isTruncated { | ||
| isExpanded = true |
There was a problem hiding this comment.
Cancel toast auto-dismiss when user expands content
When a truncated toast is expanded, the existing auto-dismiss timer keeps running, so users can swipe down to read more text and still have the toast disappear almost immediately if the timer is near expiry. Notification expansion currently cancels auto-dismiss for this reason, so this toast path should similarly stop or reset dismissal once expansion succeeds.
Useful? React with 👍 / 👎.
|
Hey! @mitre88 Everything looks solid and fully addresses all the points from #933 (gestures, indicator, contentShape, 4s timer - awesome). To help us quickly validate the visual changes (especially swipe up/down, expand/collapse, and chevron behavior), could you please attach a before/after GIF? It will speed up the review a ton. Thanks again! |
Summary
Addresses the toast UX issues reported in #933:
DragGesturetoToastView— swiping up (> 30pt) dismisses the toast.contentShape(Rectangle())so taps on the toast don't pass through to the underlying UIChanges
ToastView.swiftPopupCoordinatorView.swiftdismissActionclosure toToastViewAutoDismissManager.swiftautoDismissTimeIntervalfrom 3 to 4 secondsTest plan
Fixes #933
🤖 Generated with Claude Code