Skip to content

feat(mail): name a thread row after everyone who wrote in it - #397

Merged
krantheman merged 6 commits into
frappe:developfrom
krantheman:feat/mail-thread-participants
Jul 29, 2026
Merged

feat(mail): name a thread row after everyone who wrote in it#397
krantheman merged 6 commits into
frappe:developfrom
krantheman:feat/mail-thread-participants

Conversation

@krantheman

@krantheman krantheman commented Jul 29, 2026

Copy link
Copy Markdown
Member

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_self is 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

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>
@krantheman
krantheman requested a review from s-aga-r as a code owner July 29, 2026 13:33
krantheman and others added 5 commits July 29, 2026 21:36
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>
@krantheman
krantheman merged commit 36f21b8 into frappe:develop Jul 29, 2026
4 checks passed
@krantheman
krantheman deleted the feat/mail-thread-participants branch July 29, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant