fix(mailbox): show spinner during initial folder fetch instead of empty state #167

Merged
JMR-dev merged 3 commits from fix-149-folder-loading-spinner into main 2026-07-02 22:25:22 +00:00
3 Commits
Author SHA1 Message Date
github-actions[bot] 1cbf951ed7 Merge main into fix-149-folder-loading-spinner 2026-07-02 22:09:01 +00:00
github-actions[bot] 2956d18a7f Merge main into fix-149-folder-loading-spinner 2026-07-02 21:50:30 +00:00
JMR-devandClaude Opus 4.8 ef931a0d6e fix(mailbox): show spinner during initial folder fetch instead of empty state
selectFolder() kicked off its background syncFolder() fetch fire-and-forget
with no loading flag, so opening a per-account folder with no cached
messages yet flashed "No messages to display" for the whole IMAP fetch
instead of a spinner. Adds isSyncingFolder, a StateFlow set for the
duration of that sync (mirroring isRefreshing) and cleared via try/finally
regardless of outcome. A private latestFolderSelection token guards the
clear so a stale sync from a folder no longer selected can't hide the
spinner for whichever folder is actually selected now.

MailboxScreen's non-paged empty branch now holds NoMessagesState back
while isSyncingFolder is true, showing a CircularProgressIndicator
instead — mirroring how the unified-inbox paged branch already gates on
loadState.refresh.

Closes #149

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 16:48:35 -05:00