Skip to content

Fix toast appearance and interaction behavior#934

Open
mitre88 wants to merge 1 commit intoAdamant-im:developfrom
mitre88:fix/933-toast-appearance
Open

Fix toast appearance and interaction behavior#934
mitre88 wants to merge 1 commit intoAdamant-im:developfrom
mitre88:fix/933-toast-appearance

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented Mar 4, 2026

Summary

Addresses the toast UX issues reported in #933:

  • Swipe up to dismiss: Added DragGesture to ToastView — swiping up (> 30pt) dismisses the toast
  • Swipe down to expand: Swiping down (> 25pt) expands truncated text, matching notification behavior
  • Expand indicator: Shows a chevron.compact.down only when the message text is truncated (3-line limit), and chevron.compact.up when expanded
  • Tap pass-through blocked: Added .contentShape(Rectangle()) so taps on the toast don't pass through to the underlying UI
  • Display duration: Increased auto-dismiss timer from 3s to 4s as requested in the issue

Changes

File Change
ToastView.swift Added drag gesture (swipe up/down), text truncation detection, expand/collapse chevron, contentShape
PopupCoordinatorView.swift Pass dismissAction closure to ToastView
AutoDismissManager.swift Changed autoDismissTimeInterval from 3 to 4 seconds

Test plan

  • Toast appears at bottom and auto-dismisses after ~4 seconds
  • Swipe up on toast dismisses it immediately
  • Long toast text shows truncated with chevron indicator
  • Swipe down on truncated toast expands full text
  • Tapping the toast area does not trigger UI elements behind it
  • Short toast text does not show expand chevron

Fixes #933

🤖 Generated with Claude Code

- 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>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +71 to +72
} else if value.translation.height > 25 && isTruncated {
isExpanded = true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Lainaaa
Copy link
Copy Markdown
Member

Lainaaa commented Mar 11, 2026

Hey! @mitre88
Thanks for the PR, great work 👏

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!

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.

[Bug] Wrong in-app Toast appearance and behavior

2 participants