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.

feat(unified-list): display email drafts in inbox/signal view (#1031)

dev-rbe98aa5202bca
diff --git a/js/app/packages/app/component/UnifiedListView.tsx b/js/app/packages/app/component/UnifiedListView.tsx
index 2276598f26..c4ab38a731 100644
--- a/js/app/packages/app/component/UnifiedListView.tsx
+++ b/js/app/packages/app/component/UnifiedListView.tsx
@@ -1029,7 +1029,8 @@ export function UnifiedListView(props: UnifiedListViewProps) {
limit: props.defaultDisplayOptions?.limit ?? 100,
emailView: importantFilter()
? 'important'
- : view().id === VIEWCONFIG_DEFAULTS_IDS_ENUM.all
+ : focusFilters()?.includes('signal') ||
+ entityTypeFilter().includes('email')
? 'all'
: view().id === VIEWCONFIG_DEFAULTS_IDS_ENUM.email
? emailView()
diff --git a/js/app/packages/app/component/soupFilters.ts b/js/app/packages/app/component/soupFilters.ts
index a2195314a9..74cebfcf24 100644
--- a/js/app/packages/app/component/soupFilters.ts
+++ b/js/app/packages/app/component/soupFilters.ts
@@ -271,7 +271,7 @@ export const signalFilter: ClientFilter = {
return hasRecentlyViewed(entity);
}
case 'email': {
- return isSignalEmail(entity);
+ return isSignalEmail(entity) || entity.isDraft;
}
case 'project': {
return hasRecentlyViewed(entity);
diff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
index 878b71c8b5..e9069f2380 100644
--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
@@ -655,10 +655,19 @@ export function EntityWithEverything(
</div>
</div>
{/* Sender Name */}
- <div class="truncate @max-md/uList:min-w-0">
- {displayedNames() ??
- props.entity.senderName ??
- props.entity.senderEmail?.split('@')[0]}
+ <div class="truncate flex items-center gap-1 @max-md/uList:min-w-0">
+ <Show
+ when={props.entity.type === 'email' && props.entity.isDraft}
+ >
+ <div class="font-mono font-medium user-select-none uppercase flex items-center text-accent-30 p-0.5 gap-1 text-[0.625rem] rounded-full border border-edge-muted px-2">
+ DRAFT
+ </div>
+ </Show>
+ <span>
+ {displayedNames() ??
+ props.entity.senderName ??
+ props.entity.senderEmail?.split('@')[0]}
+ </span>
</div>
{/* Sender Email Address */}
{/* <Show
diff --git a/js/app/packages/macro-entity/src/queries/search.ts b/js/app/packages/macro-entity/src/queries/search.ts
index 384b9b371e..4ebc8a8ae0 100644
--- a/js/app/packages/macro-entity/src/queries/search.ts
+++ b/js/app/packages/macro-entity/src/queries/search.ts
@@ -249,6 +249,9 @@ const useMapSearchResponseItem = () => {
isImportant: singleMessage
? messageHits[0].labels.includes('IMPORTANT')
: false,
+ isDraft: singleMessage
+ ? messageHits[0].labels.includes('DRAFT')
+ : false,
done: singleMessage
? !messageHits[0].labels.includes('INBOX')
: false,
diff --git a/js/app/packages/macro-entity/src/types/entity.ts b/js/app/packages/macro-entity/src/types/entity.ts
index ed20a85ecd..3dad8e5bfe 100644
--- a/js/app/packages/macro-entity/src/types/entity.ts
+++ b/js/app/packages/macro-entity/src/types/entity.ts
@@ -76,6 +76,7 @@ export const getEntityProjectId = (e: EntityData): string | false => {
export type EmailEntity = EntityBase & {
type: 'email';
isRead: boolean;
+ isDraft: boolean;
snippet?: string;
isImportant: boolean;
done: boolean;