feat(mail): name a thread row after everyone who wrote in it - #397
Merged
krantheman merged 6 commits intoJul 29, 2026
Conversation
An inbox thread you had replied to was filed under your own name: the row named the latest message's sender, which is you the moment you answer. The row now names the thread's participants in the order they first wrote, with your own addresses collapsed to "me" — "Sarfaraz, me", "Brittany … Neha, me" — so it still leads with whoever started the conversation. Sent and Drafts keep naming recipients; search results are single messages and fall back to the sender. `is_self` is resolved server-side against the owning account's identities, so rows merged in from another account (All Inboxes, cross-account search) are still resolved against the right one. Stacking follows: it keyed on the latest sender too, so threads whose only common feature was your own reply piled up under your name. It now keys on the whole cast, and the stack row names itself the way its members do. Its count badge picks up a layers glyph to tell it apart from the per-thread message count now shown beside the participants. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A thread with an answer in it is correspondence, not a flood: it has a cast a stack headed by one sender cannot stand for. Stacking now takes only threads with a lone sender, so a second writer — you replying included — keeps the thread an ordinary row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A thread you had answered wore a "To:" name in every folder it sat in: the row asked whether the thread held a sent message, and a thread you have written in holds one wherever it goes. Worse, that question was put to the thread's message in the current mailbox while the recipients came from its latest message anywhere — so an archived thread whose newest mail was an incoming reply took "outgoing" from your own sent copy and then named that reply's recipient: you. The view decides it now. Sent and Drafts are about who the mail is going to and still name recipients; everywhere else the row names the thread's participants, so an archived conversation reads "Vrinda, me" rather than your own name. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Naming recipients by the view rather than by the row's mailboxes took search results with it: they are single messages, carrying mailboxes but no participants, and the search view's mailbox is the string "search" — so every mail you had sent, found by a search, dropped back to naming its sender, which is you. A page of "to:bob" hits read as your own name, over and over, with no sign of who any of them had gone to. Search keeps the old test, on the message's own mailboxes, since there is no thread behind the row to name instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The thread pane hides junked and trashed messages outside their own folders; the summary row counted them. A single spam reply put a stranger's name among a thread's participants, added to its message count, and handed it its preview and its date — all borrowed from a message the pane refused to render, so the row and the open thread told different stories about the same conversation. Rows are now derived from the messages the view can actually show, by the same rule the pane applies. The subject still comes from the conversation's opening message, which may itself be filtered out, so a thread keeps the name it was given rather than a reply's "Re:". Drafts joins Sent in following the folder's own latest message. It had followed the conversation's, so a draft reply left on a thread that then received a new mail showed that mail's recipients, preview and time — and, since the draft flag came from there too, lost the badge saying it was a draft at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deriving a row from the messages its view can show wants four mailbox roles, and asking for them one at a time re-resolved the account's user and connection on every ask — three pairs of DB queries added to each page of threads for ids that all sit in the same cached list. They come off that list once now, which is what the single role lookup here cost before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
An inbox thread you had replied to was filed under your own name — the row named the latest message's sender, which is you the moment you answer.
Rows now name the thread's participants in the order they first wrote, with your own addresses collapsed to
me:Sarfaraz, me,Brittany … Neha, me. Sent and Drafts still name recipients; search results are single messages and fall back to the sender.is_selfis resolved server-side against the owning account's identities, so rows merged in from another account (All Inboxes, cross-account search) resolve against the right one.Stacking keyed on the latest sender too, so threads whose only common feature was your own reply piled up under your name. Only threads with a lone sender stack now — a second writer, you replying included, keeps the thread an ordinary row — and the stack row names itself the way its members do. Its count badge picks up a layers glyph to tell it apart from the per-thread message count now shown beside the participants.
🤖 Generated with Claude Code