fix(thread): show every message of the thread, not just the tapped one - #43
Open
lucletoffe wants to merge 1 commit into
Open
fix(thread): show every message of the thread, not just the tapped one#43lucletoffe wants to merge 1 commit into
lucletoffe wants to merge 1 commit into
Conversation
The list collapses same-thread messages into one row with a count badge, but opening it showed a single message: EmailThreadScreen never used its threadId param, so the rest of the conversation — including replies filed in Sent — was unreachable from the thread view. Each pager pane now fetches the thread (Thread/get + a light Email/get, coalesced across the three mounted panes) and renders it oldest-first: collapsed header rows (sender, preview, date, unread dot) that unfold in place, the tapped message expanded from the start. Expanding a message loads its body on demand and marks it read. The subject row shows the real thread size, which can exceed the list badge (that badge only counts messages in the open folder). The former pane body (sender header, attachments, calendar banner, body) is extracted as MessageSection, rendered once per expanded message; a thread fetch failure degrades to the previous single-message view. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ACzTUX8qVZ4qAp8gqUHb5t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The email list collapses same-thread messages into one row with a count badge — but tapping that row shows a single message.
EmailThreadScreenreceives athreadIdroute param and never uses it: each pager pane renders only the tapped email, and Prev/Next walk the flat mailbox list. The rest of the conversation — including your own replies filed in Sent — is unreachable from the thread view.What this PR does
Each pager pane now renders the whole thread, oldest first:
threadId(Thread/get+ a lightEmail/get, coalesced and cached across the three mounted panes) and follows the server's ordering (RFC 8621 §3).Implementation notes
EmailBodyView) is extracted asMessageSection, rendered once per expanded message; the single-message path renders it identically to before (header stays non-pressable there).markReadwould rebuild its keyword map from nothing — JMAPEmail/setreplaceskeywordswholesale, wiping$flaggedand user labels server-side. Such messages go throughsetEmailKeywordswith the keywords merged from the fetched copy instead; in-list messages keep the store's optimistic path.Thread/get/Email/getride the pane'sownerAccountId.orderThreadEmails(server order, drops ids whose metadata didn't come back) is a pure function inlib/email-threading.ts, unit-tested.Tests
orderThreadEmails: server-order preservation, expunged-id drop, empty thread.npx tsc --noEmitclean;vitest438/438 passing (theauth-store.test.tscollection error is pre-existing onmain).🤖 Generated with Claude Code
https://claude.ai/code/session_01ACzTUX8qVZ4qAp8gqUHb5t