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(email): Always open attachments in split (#1630)

Evan Hutnikd4147981bf4e
diff --git a/js/app/packages/block-email/component/AttachmentPill.tsx b/js/app/packages/block-email/component/AttachmentPill.tsx
index 8d6b3faedf..e46bf8fe6e 100644
--- a/js/app/packages/block-email/component/AttachmentPill.tsx
+++ b/js/app/packages/block-email/component/AttachmentPill.tsx
@@ -12,7 +12,7 @@ type EmailAttachmentPillProps = {
attachment: { fileName: string; mimeType?: string };
removable?: boolean;
onRemove?: () => void;
- onClick?: (event: MouseEvent, fileType?: FileType) => void;
+ onClick?: (fileType?: FileType) => void;
};
export function EmailAttachmentPill(props: EmailAttachmentPillProps) {
@@ -30,7 +30,7 @@ export function EmailAttachmentPill(props: EmailAttachmentPillProps) {
classList={{
'pl-2': props.removable,
}}
- onClick={(e) => props.onClick?.(e, fileType())}
+ onClick={() => props.onClick?.(fileType())}
>
<Show when={fileType() !== undefined || props.attachment.mimeType}>
<EntityIcon
diff --git a/js/app/packages/block-email/component/MessageContainer.tsx b/js/app/packages/block-email/component/MessageContainer.tsx
index 17e436ccf9..bb22ec6207 100644
--- a/js/app/packages/block-email/component/MessageContainer.tsx
+++ b/js/app/packages/block-email/component/MessageContainer.tsx
@@ -144,7 +144,6 @@ export function MessageContainer(props: MessageContainerProps) {
});
const onClickAttachment = async (
- event: MouseEvent,
attachment: Attachment,
fileType: FileType | undefined
) => {
@@ -185,7 +184,7 @@ export function MessageContainer(props: MessageContainerProps) {
const blockName = fileType ? fileTypeToBlockName(fileType) : 'unknown';
openWithSplit(
{ type: blockName, id: document_id },
- { preferNewSplit: event.shiftKey }
+ { preferNewSplit: true }
);
};
@@ -284,8 +283,8 @@ export function MessageContainer(props: MessageContainerProps) {
fileName: attachment.filename ?? '',
mimeType: attachment.mime_type ?? undefined,
}}
- onClick={(event, fileType) =>
- onClickAttachment(event, attachment, fileType)
+ onClick={(fileType) =>
+ onClickAttachment(attachment, fileType)
}
/>
)}