27b7b1f
fix: preserve paginated emails during background refresh (#235)
Click to expand commit body
* fix: preserve paginated emails during background refresh
EmailsRefreshedMsg was overwriting m.emailsByAcct and rebuilding
m.emails from scratch, discarding any emails loaded via pagination.
This caused a race where paginated emails appeared in the inbox list
but could not be opened because they no longer existed in the main
model's email store.
Merge refreshed emails with existing paginated emails instead of
replacing them. Also remove an unnecessary getEmailByUIDAndAccount
lookup in ViewEmailMsg that silently blocked opening emails not yet
in the store, and drop the unused email parameter from
fetchEmailBodyCmd.
* fix: restore email existence guard in ViewEmailMsg
Keep the pre-fetch check to avoid unnecessary IMAP server calls
for emails not in the local store. The merge fix in
EmailsRefreshedMsg ensures paginated emails are preserved, so
this guard now works correctly.
* fix: prevent email view from closing after paginated emails load
Three interconnected issues caused the email view to auto-close when
opening an email that was loaded via pagination:
1. The inbox's EmailsRefreshedMsg handler overwrote its internal email
data with the raw (unmerged) refresh response, discarding paginated
emails. Since main.go already merges the data and pushes it via
SetEmails, the inbox handler now only clears the refreshing flag.
2. EmailsRefreshedMsg was forwarded to m.current twice: once at the top
of Update (line 110) and again explicitly. This second call could
target the wrong component or overwrite correctly merged data. Fixed
by calling m.inbox.Update() directly to clear the refreshing state.
3. The EmailsFetchedMsg handler unconditionally set m.current = m.inbox,
which would close the email view if a pagination fetch with offset 0
completed while the user was reading an email. Fixed by only switching
to inbox from a loading screen, not from an active email view.
Signed-off-by: drew <me@andrinoff.com>
---------
Signed-off-by: drew <me@andrinoff.com>
Co-authored-by: drew <me@andrinoff.com>
arclayto
and
drew
created
fbddb86
fix: mark emails as read when opened (#233)
Click to expand commit body
Add MarkEmailAsRead() that sets the IMAP \Seen flag via UidStore.
Called from FetchEmailBodyFromMailbox() after successfully fetching
the email body. Uses the existing BODY.PEEK[] fetch to keep fetch
and flag-setting separate.
Fixes #232
arclayto
created
17914d9
fix: sort email batches by date instead of UID (#231)
Click to expand commit body
UID ordering is not reliable for all IMAP servers (e.g. Proton Bridge),
causing emails to display oldest-first. Sort by Date instead, consistent
with the Date-based sorting already used elsewhere in the codebase.
Fixes #230
* docs: add MacOS guide (#169)
* docs: installation on Linux (#168)
* feat: Windows install guide
* docs: update README to include new link to docs (#166)
* ci: remove HOME override
* fix: remove install-fonts
* fix: manual install of vhs
cause: charmbracelet/vhs-action#459
* fix: not persist credentials
* chore: update tape
* fix: update branch name
* fix: update the path of config
* fix: get font and load in color
* fix: attempting to get color and cursor
* fix: remove build step
* include version in go build