fix: snack bar now auto-dismisses after delete in mail detail view #401

Merged
guettlibot merged 1 commits from refs/pull/401/head into main 2026-06-04 04:15:38 +00:00
guettlibot commented 2026-06-04 01:56:50 +00:00 (Migrated from codeberg.org)

Summary

  • When deleting a mail from the single Mail View, `pushAction()` was called with `unawaited` before `_navigateTo()`. This meant the UndoShell snack bar fired after navigation had already started, showing the snack bar on the destination scaffold mid-transition — which prevented the snack bar's duration timer from starting correctly.
  • Fixed by changing `unawaited(pushAction(...))` to `await pushAction(...)`. Since Riverpod fires `ref.listen` synchronously when state changes, the UndoShell now queues the snack bar on the current stable scaffold before `_navigateTo()` is called. The snack bar then naturally transfers to the destination scaffold and auto-dismisses after 5 seconds as intended.

Closes #399

Test plan

  • All 338 unit/widget tests pass
  • Manually delete a mail from single Mail View and verify the snack bar appears and auto-dismisses after ~5 seconds
  • Verify the Undo button in the snack bar still works
## Summary - When deleting a mail from the single Mail View, \`pushAction()\` was called with \`unawaited\` before \`_navigateTo()\`. This meant the UndoShell snack bar fired *after* navigation had already started, showing the snack bar on the destination scaffold mid-transition — which prevented the snack bar's duration timer from starting correctly. - Fixed by changing \`unawaited(pushAction(...))\` to \`await pushAction(...)\`. Since Riverpod fires \`ref.listen\` synchronously when state changes, the UndoShell now queues the snack bar on the current stable scaffold *before* \`_navigateTo()\` is called. The snack bar then naturally transfers to the destination scaffold and auto-dismisses after 5 seconds as intended. Closes #399 ## Test plan - [x] All 338 unit/widget tests pass - [ ] Manually delete a mail from single Mail View and verify the snack bar appears and auto-dismisses after ~5 seconds - [ ] Verify the Undo button in the snack bar still works
Sign in to join this conversation.