feat: allow manual entry of glob patterns for trusted image senders #480

Merged
guettlibot merged 6 commits from issue-475-allowed-addresses-glob into main 2026-06-07 02:38:23 +00:00
guettlibot commented 2026-06-06 14:53:19 +00:00 (Migrated from codeberg.org)

Closes #475

Summary

  • Added a + FAB to the Allowed addresses for images screen so users can manually add an email address or glob pattern (e.g. *@example.com) without having to first open an email
  • The add dialog shows hint text *@example.com and helper text * matches any characters, e.g. *@example.com to inform users that globbing is supported
  • Updated the empty-state message to also mention the + button and glob syntax
  • Extracted a shared globMatch utility from the Sieve interpreter into lib/core/utils/glob_match.dart (case-insensitive, supports * and ?)
  • Updated trusted-sender matching in EmailDetailScreen and ThreadDetailScreen to use glob matching instead of exact contains — so a stored pattern like *@example.com now automatically allows all senders from that domain

Test plan

  • New unit tests in test/unit/glob_match_test.dart cover wildcard, case-insensitive, ?, and edge cases
  • New widget tests in test/widget/trusted_image_senders_screen_test.dart cover: empty state, listing patterns, add dialog hints, Add button disabled on empty input, adding a sender, cancel, and delete
  • All 512 existing tests continue to pass (task test)
Closes #475 ## Summary - Added a `+` FAB to the **Allowed addresses for images** screen so users can manually add an email address or glob pattern (e.g. `*@example.com`) without having to first open an email - The add dialog shows hint text `*@example.com` and helper text `* matches any characters, e.g. *@example.com` to inform users that globbing is supported - Updated the empty-state message to also mention the `+` button and glob syntax - Extracted a shared `globMatch` utility from the Sieve interpreter into `lib/core/utils/glob_match.dart` (case-insensitive, supports `*` and `?`) - Updated trusted-sender matching in `EmailDetailScreen` and `ThreadDetailScreen` to use glob matching instead of exact `contains` — so a stored pattern like `*@example.com` now automatically allows all senders from that domain ## Test plan - New unit tests in `test/unit/glob_match_test.dart` cover wildcard, case-insensitive, `?`, and edge cases - New widget tests in `test/widget/trusted_image_senders_screen_test.dart` cover: empty state, listing patterns, add dialog hints, Add button disabled on empty input, adding a sender, cancel, and delete - All 512 existing tests continue to pass (`task test`)
Sign in to join this conversation.