Replaces the IMAP live search in searchEmails with a local SQLite FTS5 query filtered by mailbox_path, reusing the same email_fts virtual table and _toFtsQuery helper that backs searchEmailsGlobal.
Removes the IMAP-specific _toAddressList helper (was only used by the old IMAP search path).
Updates two stale comments in email_list_screen.dart that referenced IMAP.
How it works
The new SQL mirrors searchEmailsGlobal with one extra condition:
Folder-view search now works fully offline, and tapping a result always opens the correct email since IDs come from the same local DB as getEmail.
Verification
Added a unit test (searchEmails filters by mailboxPath using local FTS5) that inserts emails in two mailboxes, searches INBOX, and confirms only the INBOX email is returned.
Added a widget test (folder search returns results from local cache without any network call) that verifies results are returned without a network round-trip.
## Summary
- Replaces the IMAP live search in `searchEmails` with a local SQLite FTS5 query filtered by `mailbox_path`, reusing the same `email_fts` virtual table and `_toFtsQuery` helper that backs `searchEmailsGlobal`.
- Removes the IMAP-specific `_toAddressList` helper (was only used by the old IMAP search path).
- Updates two stale comments in `email_list_screen.dart` that referenced IMAP.
## How it works
The new SQL mirrors `searchEmailsGlobal` with one extra condition:
```sql
SELECT e.* FROM email_fts f JOIN emails e ON e.rowid = f.rowid
WHERE email_fts MATCH ? AND e.account_id = ? AND e.mailbox_path = ?
ORDER BY rank LIMIT 50
```
Folder-view search now works fully offline, and tapping a result always opens the correct email since IDs come from the same local DB as `getEmail`.
## Verification
- Added a unit test (`searchEmails filters by mailboxPath using local FTS5`) that inserts emails in two mailboxes, searches INBOX, and confirms only the INBOX email is returned.
- Added a widget test (`folder search returns results from local cache without any network call`) that verifies results are returned without a network round-trip.
- All 498 existing tests continue to pass.
Closes #501
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
searchEmailswith a local SQLite FTS5 query filtered bymailbox_path, reusing the sameemail_ftsvirtual table and_toFtsQueryhelper that backssearchEmailsGlobal._toAddressListhelper (was only used by the old IMAP search path).email_list_screen.dartthat referenced IMAP.How it works
The new SQL mirrors
searchEmailsGlobalwith one extra condition:Folder-view search now works fully offline, and tapping a result always opens the correct email since IDs come from the same local DB as
getEmail.Verification
searchEmails filters by mailboxPath using local FTS5) that inserts emails in two mailboxes, searches INBOX, and confirms only the INBOX email is returned.folder search returns results from local cache without any network call) that verifies results are returned without a network round-trip.Closes #501