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(soup): unify email tab filters and rename Important to Signal (#2130)

Evan Hutnika03b7e989f02
diff --git a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts b/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
index 18a85aa3f5..9ac4e342fa 100644
--- a/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
+++ b/js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
@@ -11,6 +11,24 @@ import type { ListView } from '@app/constants/list-views';
import type { SoupBody } from '@queries/soup/items';
import { SharedEmailFilter } from '@service-storage/generated/schemas';
+/** Shared query filters for the "Signal" tab across Inbox and Email views. */
+export const SIGNAL_QUERY_FILTERS = {
+ email_filters: {
+ importance: true as const,
+ shared: SharedEmailFilter.exclude,
+ },
+ emailView: 'inbox' as const,
+};
+
+/** Shared query filters for the "Noise" tab across Inbox and Email views. */
+export const NOISE_QUERY_FILTERS = {
+ email_filters: {
+ importance: false as const,
+ shared: SharedEmailFilter.exclude,
+ },
+ emailView: 'inbox' as const,
+};
+
export type SoupFiltersPreset = {
queryFilters: SoupBody;
clientFilters: {
@@ -47,11 +65,7 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {
return {
queryFilters: {
...filters,
- email_filters: {
- ...filters.email_filters,
- shared: SharedEmailFilter.exclude,
- },
- emailView: 'inbox',
+ ...SIGNAL_QUERY_FILTERS,
},
clientFilters: { and: ['signal', 'not-done'] },
};
@@ -63,11 +77,7 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {
return {
queryFilters: {
...filters,
- email_filters: {
- ...filters.email_filters,
- shared: SharedEmailFilter.exclude,
- },
- emailView: 'inbox',
+ ...NOISE_QUERY_FILTERS,
},
clientFilters: { and: ['noise', 'not-done'] },
};
@@ -111,20 +121,14 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {
important: () => ({
queryFilters: {
...QUERY_FILTERS.email,
- email_filters: {
- importance: true,
- shared: SharedEmailFilter.exclude,
- },
+ ...SIGNAL_QUERY_FILTERS,
},
clientFilters: { and: ['email', 'no-drafts'] },
}),
noise: () => ({
queryFilters: {
...QUERY_FILTERS.email,
- email_filters: {
- importance: false,
- shared: SharedEmailFilter.exclude,
- },
+ ...NOISE_QUERY_FILTERS,
},
clientFilters: { and: ['email', 'no-drafts'] },
}),
@@ -158,6 +162,14 @@ export const VIEW_TAB_PRESETS: Record<ListView, ViewTabConfig> = {
},
clientFilters: { and: ['email'] },
}),
+ all: () => ({
+ queryFilters: {
+ ...QUERY_FILTERS.email,
+ email_filters: { shared: SharedEmailFilter.include },
+ emailView: 'all',
+ },
+ clientFilters: { and: ['email'] },
+ }),
},
},
documents: {
diff --git a/js/app/packages/app/component/next-soup/filters/inbox-filters.ts b/js/app/packages/app/component/next-soup/filters/inbox-filters.ts
index 6b6105a1ca..fbc683a996 100644
--- a/js/app/packages/app/component/next-soup/filters/inbox-filters.ts
+++ b/js/app/packages/app/component/next-soup/filters/inbox-filters.ts
@@ -20,7 +20,7 @@ const PRIORITY_LABELS = [
},
{
key: 'IMPORTANT',
- label: 'Important',
+ label: 'Signal',
defaultValue: false,
},
];
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
index 6d1389fbfe..78b9605a0e 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
@@ -45,11 +45,12 @@ export const VIEW_TAB_LISTS: Record<TabbedListView, TabItem[]> = {
{ value: 'shared', label: 'Shared' },
],
mail: [
- { value: 'important', label: 'Important' },
+ { value: 'important', label: 'Signal' },
{ value: 'noise', label: 'Noise' },
- { value: 'drafts', label: 'Drafts' },
{ value: 'sent', label: 'Sent' },
+ { value: 'drafts', label: 'Drafts' },
{ value: 'shared', label: 'Shared' },
+ { value: 'all', label: 'All' },
],
documents: [
{ value: 'owned', label: 'Owned' },
diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsx
index 2858c26776..af3dbf1f2e 100644
--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx
+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx
@@ -129,7 +129,7 @@ registerComponent(
const preset = getDefaultListViewPreset('mail');
return (
<SoupView
- viewName="Mail"
+ viewName="Email"
queryFilters={preset.queryFilters}
initialClientFilters={preset.clientFilters}
/>