From 58373c9d5945eb26cdd00d076836c9508d3e38da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 24 Jul 2026 08:21:40 +0000 Subject: [PATCH] email: group messages into conversations (Gmail-style threading) Hybrid grouping via a new thread_id column: new mail threads exactly on References/In-Reply-To (id is sha1(Message-Id), so a referenced id hashes to the ancestor's own id); already-synced mail is backfilled with a normalized-subject + counterpart key. Folder views collapse to one row per thread with a count badge; the reader shows the thread as a collapsible stack. Co-Authored-By: Claude Opus 4.8 --- .../Screens/Dashboard/Email/EmailList.tsx | 11 +- .../Screens/Dashboard/Email/EmailReader.tsx | 203 ++++++++++++------ src/servers/api/email/email-db.ts | 93 +++++++- src/servers/api/email/email.ts | 105 ++++++--- src/workspaces/types/email.ts | 10 + src/workspaces/types/index.ts | 2 +- 6 files changed, 321 insertions(+), 103 deletions(-) diff --git a/src/apps/officer-web/Screens/Dashboard/Email/EmailList.tsx b/src/apps/officer-web/Screens/Dashboard/Email/EmailList.tsx index f0f0618a..44482c64 100644 --- a/src/apps/officer-web/Screens/Dashboard/Email/EmailList.tsx +++ b/src/apps/officer-web/Screens/Dashboard/Email/EmailList.tsx @@ -300,7 +300,7 @@ export const EmailList = () => { ) : (
{messages.map((msg: EmailSummary) => { - const unread = !msg.read; + const unread = msg.threadUnread !== undefined ? msg.threadUnread > 0 : !msg.read; return (