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: channel thread/message mention hover text (#1491)

gbirman10b1de03e5f5
diff --git a/js/app/packages/core/component/DocumentPreview.tsx b/js/app/packages/core/component/DocumentPreview.tsx
index e6334b5690..40cf20fff8 100644
--- a/js/app/packages/core/component/DocumentPreview.tsx
+++ b/js/app/packages/core/component/DocumentPreview.tsx
@@ -296,10 +296,19 @@ export function PopupPreview(props: {
const blockName = useMaybeBlockName();
const blockId = useMaybeBlockId();
- const { item, ItemEntityIcon } = useItemPreviewData(() => ({
- id: props.documentInfo.id,
- type: blockNameToItemType(props.documentInfo.type),
- }));
+ const itemPreviewEntity = () => {
+ const type = blockNameToItemType(props.documentInfo.type);
+ let messageId: string | undefined;
+ if (
+ type === 'channel' &&
+ URL_PARAMS_CHANNEL.message in props.documentInfo.params
+ ) {
+ messageId = props.documentInfo.params[URL_PARAMS_CHANNEL.message];
+ }
+ return { id: props.documentInfo.id, type, messageId };
+ };
+
+ const { item, ItemEntityIcon } = useItemPreviewData(itemPreviewEntity);
// Derived state
const canOpenInChat = createCallback(() => {