The "Load remote images" snack bar in single-mail view (and the analogous thread view) never disappeared on its own — the user had to interact with it.
Flutter's SnackBar defaults to persist: true whenever an action is provided (see flutter/lib/src/material/snack_bar.dart: persist = persist ?? action != null), which short-circuits the duration-based dismiss timer in ScaffoldMessengerState.build:
_snackBarTimer=Timer(snackBar.duration,(){if(snackBar.persist)return;// <-- here
hideCurrentSnackBar(reason:SnackBarClosedReason.timeout);});
So the explicit duration: 3s was set, but the "View" action made the snack bar persistent and the timer's callback returned early.
Pass persist: false explicitly on both snack bars so the 3-second timer fires and the snack bar slides away on its own, while the "View" action button still works to navigate to the trusted-senders settings.
Test plan
Added widget regression test in test/widget/email_detail_screen_test.dart (Load remote images snack bar auto-dismisses after 3 seconds).
Added analogous test in test/widget/thread_detail_screen_test.dart.
task test-widget — all 174 widget tests pass.
scripts/run_unit_tests.sh — all 552 unit tests pass.
fvm dart analyze --fatal-infos on changed files — no issues.
fvm dart format — no diffs.
Manual: open a single mail with HTML body from an untrusted sender; tap "Load remote images"; verify the snack bar appears, images load, and the snack bar disappears after ~3 seconds while the "View" action button still navigates to /accounts/trusted-senders when tapped.
## Summary
- The "Load remote images" snack bar in single-mail view (and the analogous thread view) never disappeared on its own — the user had to interact with it.
- Flutter's `SnackBar` defaults to `persist: true` whenever an `action` is provided (see `flutter/lib/src/material/snack_bar.dart`: `persist = persist ?? action != null`), which short-circuits the duration-based dismiss timer in `ScaffoldMessengerState.build`:
```dart
_snackBarTimer = Timer(snackBar.duration, () {
if (snackBar.persist) return; // <-- here
hideCurrentSnackBar(reason: SnackBarClosedReason.timeout);
});
```
So the explicit `duration: 3s` was set, but the "View" action made the snack bar persistent and the timer's callback returned early.
- Pass `persist: false` explicitly on both snack bars so the 3-second timer fires and the snack bar slides away on its own, while the "View" action button still works to navigate to the trusted-senders settings.
## Test plan
- [x] Added widget regression test in `test/widget/email_detail_screen_test.dart` (`Load remote images snack bar auto-dismisses after 3 seconds`).
- [x] Added analogous test in `test/widget/thread_detail_screen_test.dart`.
- [x] `task test-widget` — all 174 widget tests pass.
- [x] `scripts/run_unit_tests.sh` — all 552 unit tests pass.
- [x] `fvm dart analyze --fatal-infos` on changed files — no issues.
- [x] `fvm dart format` — no diffs.
- [ ] Manual: open a single mail with HTML body from an untrusted sender; tap "Load remote images"; verify the snack bar appears, images load, and the snack bar disappears after ~3 seconds while the "View" action button still navigates to `/accounts/trusted-senders` when tapped.
Closes #484
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The "Load remote images" snack bar in single-mail view (and the analogous thread view) never disappeared on its own — the user had to interact with it.
Flutter's
SnackBardefaults topersist: truewhenever anactionis provided (seeflutter/lib/src/material/snack_bar.dart:persist = persist ?? action != null), which short-circuits the duration-based dismiss timer inScaffoldMessengerState.build:So the explicit
duration: 3swas set, but the "View" action made the snack bar persistent and the timer's callback returned early.Pass
persist: falseexplicitly on both snack bars so the 3-second timer fires and the snack bar slides away on its own, while the "View" action button still works to navigate to the trusted-senders settings.Test plan
test/widget/email_detail_screen_test.dart(Load remote images snack bar auto-dismisses after 3 seconds).test/widget/thread_detail_screen_test.dart.task test-widget— all 174 widget tests pass.scripts/run_unit_tests.sh— all 552 unit tests pass.fvm dart analyze --fatal-infoson changed files — no issues.fvm dart format— no diffs./accounts/trusted-senderswhen tapped.Closes #484