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(call): correctly filter calls in attachments and support click on attachment to go to call record (#2610)

Will Hutchinsondc271fa73154
diff --git a/js/app/CLAUDE.md b/js/app/CLAUDE.md
index 47dc3e3d86..96140f7a0d 100644
--- a/js/app/CLAUDE.md
+++ b/js/app/CLAUDE.md
@@ -1 +1,5 @@
-AGENTS.md
\ No newline at end of file
+AGENTS.md
+
+## Development
+
+- Use `bun` as the package manager and script runner (e.g. `bun run build`, `bunx tsc`).
\ No newline at end of file
diff --git a/js/app/packages/channel/Attachments/ChannelAttachmentEntitySection.tsx b/js/app/packages/channel/Attachments/ChannelAttachmentEntitySection.tsx
index b2884ca377..fb8a33f755 100644
--- a/js/app/packages/channel/Attachments/ChannelAttachmentEntitySection.tsx
+++ b/js/app/packages/channel/Attachments/ChannelAttachmentEntitySection.tsx
@@ -33,7 +33,10 @@ export function ChannelAttachmentEntitySection(props: { channelId: string }) {
const soupQuery = useSoupItemsQuery(
() => ({
params: { limit: 500 },
- body: buildAttachmentEntityFilters(documentAttachments()),
+ body: buildAttachmentEntityFilters(
+ documentAttachments(),
+ props.channelId
+ ),
}),
() => ({ enabled: documentAttachments().length > 0 })
);
diff --git a/js/app/packages/channel/Attachments/attachment-utils.ts b/js/app/packages/channel/Attachments/attachment-utils.ts
index 6c237e84e2..4ab63d4411 100644
--- a/js/app/packages/channel/Attachments/attachment-utils.ts
+++ b/js/app/packages/channel/Attachments/attachment-utils.ts
@@ -26,7 +26,8 @@ export function itemsPerRow(containerWidth: number): number {
* so they return nothing instead of everything.
*/
export function buildAttachmentEntityFilters(
- attachments: ApiChannelAttachment[]
+ attachments: ApiChannelAttachment[],
+ channelId: string
) {
const documentIds: string[] = [];
const emailIds: string[] = [];
@@ -69,6 +70,9 @@ export function buildAttachmentEntityFilters(
project_filters: {
project_ids: projectIds.length > 0 ? projectIds : [NIL_ID],
},
+ call_filters: {
+ channel_ids: [channelId],
+ },
};
}
@@ -94,8 +98,8 @@ export function getEntityClickContent(entity: EntityData): SplitContent {
params: getChannelParams(e.messageId, e.threadId),
}))
.with({ type: 'call' }, (e) => ({
- type: 'channel' as const,
- id: e.channelId,
+ type: 'call' as const,
+ id: e.id,
}))
.exhaustive();
}