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(tasks): tasks in signal tab, refresh queries on task notifs (#779)

Seamus5e920c012a54
diff --git a/js/app/packages/app/component/Soup.tsx b/js/app/packages/app/component/Soup.tsx
index 025f32712c..d5dc1a5177 100644
--- a/js/app/packages/app/component/Soup.tsx
+++ b/js/app/packages/app/component/Soup.tsx
@@ -328,6 +328,19 @@ export function Soup() {
});
});
+ createEffectOnEntityTypeNotification(
+ notificationSource,
+ 'document',
+ (notification) => {
+ if (notification.notificationEventType === 'task_assigned') {
+ entityQueryClient.invalidateQueries({
+ queryKey: queryKeys.all.dss,
+ });
+ invalidateEntityNotifications(notification.entity_id);
+ }
+ }
+ );
+
const saveViewMutation = useUpsertSavedViewMutation();
let tabsRef: HTMLDivElement | undefined;
diff --git a/js/app/packages/app/component/soupFilters.ts b/js/app/packages/app/component/soupFilters.ts
index d2d76f921d..f8929a218c 100644
--- a/js/app/packages/app/component/soupFilters.ts
+++ b/js/app/packages/app/component/soupFilters.ts
@@ -1,4 +1,4 @@
-import type { EntityData } from '@macro-entity';
+import { type EntityData, isTaskEntity } from '@macro-entity';
import type { APIEmailThreadPreviewMetadata } from '@service-email/generated/schemas';
import type { SoupEmailThreadPreviewMetadata } from '@service-storage/generated/schemas';
import { makePersisted } from '@solid-primitives/storage';
@@ -253,6 +253,10 @@ export const signalFilter: ClientFilter = {
return hasRecentlyViewed(entity);
}
case 'document': {
+ if (isTaskEntity(entity)) {
+ // TODO (seamus) : filter on isCompleted
+ return true;
+ }
return hasRecentlyViewed(entity);
}
case 'email': {
diff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
index cf166c13b9..4a4a905c6a 100644
--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx
@@ -279,6 +279,9 @@ function NotificationRow(props: {
) {
return 'shared';
}
+ if (props.notification.notificationEventType === 'task_assigned') {
+ return 'assigned to you';
+ }
const metadata = tryToTypedNotification(
props.notification