Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email): keep messages with draft replies expanded in thread view (#5041)

Evan Hutnikd5c38464c9dc
diff --git a/apps/web/src/features/block-email/component/MessageList.tsx b/apps/web/src/features/block-email/component/MessageList.tsx
index d152d3fc9a..330aca6cf5 100644
--- a/apps/web/src/features/block-email/component/MessageList.tsx
+++ b/apps/web/src/features/block-email/component/MessageList.tsx
@@ -134,6 +134,15 @@ export function MessageList(props: MessageListProps) {
);
});
+ // A message with an in-progress draft reply stays expanded so the
+ // draft remains visible even after newer messages arrive (matches
+ // Gmail/Superhuman). Desktop only: mobile edits drafts in a drawer.
+ const hasDraft = createMemo(() => {
+ const messageID = message().db_id;
+ if (!messageID || isMobile()) return false;
+ return !!context.drafts.getDraftForMessage(messageID);
+ });
+
const isExpanded = createMemo(() => {
const messageID = message().db_id;
@@ -141,7 +150,12 @@ export function MessageList(props: MessageListProps) {
const manuallyExpanded =
context.messages.isBodyExpanded(messageID);
- return manuallyExpanded || isLastMessage() || isNewMessage();
+ return (
+ manuallyExpanded ||
+ isLastMessage() ||
+ isNewMessage() ||
+ hasDraft()
+ );
});
return (