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): add support for filtering individual email threads in soup

synoetaed697b60503
diff --git a/js/app/packages/queries/soup/normalized-cache/operations.test.ts b/js/app/packages/queries/soup/normalized-cache/operations.test.ts
index 5053f49183..a4b50846d8 100644
--- a/js/app/packages/queries/soup/normalized-cache/operations.test.ts
+++ b/js/app/packages/queries/soup/normalized-cache/operations.test.ts
@@ -216,10 +216,6 @@ describe('buildSingleEntityFilter', () => {
}
}
);
-
- it('returns null for emailThread', () => {
- expect(buildSingleEntityFilter('emailThread', 'e-1')).toBeNull();
- });
});
describe('insertSoupEntity', () => {
diff --git a/js/app/packages/queries/soup/normalized-cache/operations.ts b/js/app/packages/queries/soup/normalized-cache/operations.ts
index 67cf09ddd7..a685bb3dce 100644
--- a/js/app/packages/queries/soup/normalized-cache/operations.ts
+++ b/js/app/packages/queries/soup/normalized-cache/operations.ts
@@ -243,27 +243,27 @@ export function buildSingleEntityFilter(
chat_filters: { chat_ids: [NIL_ID] },
channel_filters: { channel_ids: [NIL_ID] },
project_filters: { project_ids: [NIL_ID] },
- email_filters: { importance: false },
+ email_filters: { email_thread_ids: [NIL_ID] },
};
- return (
- match(entityType)
- .with('document', () => ({
- ...base,
- document_filters: { document_ids: [entityId] },
- }))
- .with('chat', () => ({ ...base, chat_filters: { chat_ids: [entityId] } }))
- .with('channel', () => ({
- ...base,
- channel_filters: { channel_ids: [entityId] },
- }))
- .with('project', () => ({
- ...base,
- project_filters: { project_ids: [entityId] },
- }))
- //TODO: need to add backend support for email threads
- .with('emailThread', () => null)
- .exhaustive()
- );
+ return match(entityType)
+ .with('document', () => ({
+ ...base,
+ document_filters: { document_ids: [entityId] },
+ }))
+ .with('chat', () => ({ ...base, chat_filters: { chat_ids: [entityId] } }))
+ .with('channel', () => ({
+ ...base,
+ channel_filters: { channel_ids: [entityId] },
+ }))
+ .with('project', () => ({
+ ...base,
+ project_filters: { project_ids: [entityId] },
+ }))
+ .with('emailThread', () => ({
+ ...base,
+ email_filters: { email_thread_ids: [entityId] },
+ }))
+ .exhaustive();
}
/**