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(ai): mobile overflow (#3273)

Eric Hayes771a331c6b7d
diff --git a/js/app/packages/core/component/AI/component/input/Attachment.tsx b/js/app/packages/core/component/AI/component/input/Attachment.tsx
index 207c8efe63..b5917fbcca 100644
--- a/js/app/packages/core/component/AI/component/input/Attachment.tsx
+++ b/js/app/packages/core/component/AI/component/input/Attachment.tsx
@@ -109,7 +109,7 @@ function ChatAttachment(props: {
props.attachment.entity_type
)}
>
- <div class="flex items-center px-1 space-x-1 hover:bg-hover hover-transition-bg cursor-default text-sm border border-edge-muted rounded-xs">
+ <div class="flex items-center px-1 space-x-1 hover:bg-hover hover-transition-bg cursor-default text-sm border border-edge-muted rounded-xs max-w-full min-w-0">
<ItemPreview
id={props.attachment.entity_id}
type={
diff --git a/js/app/packages/core/component/AI/component/message/UserMessage.tsx b/js/app/packages/core/component/AI/component/message/UserMessage.tsx
index 70023dca56..255c662dc1 100644
--- a/js/app/packages/core/component/AI/component/message/UserMessage.tsx
+++ b/js/app/packages/core/component/AI/component/message/UserMessage.tsx
@@ -44,8 +44,8 @@ export function UserMessage(props: {
let content;
const messageContent = props.message.content as string;
if (messageContent.startsWith('<quote>')) {
- let start = messageContent.indexOf('<quote>');
- let end = messageContent.indexOf('</quote>');
+ const start = messageContent.indexOf('<quote>');
+ const end = messageContent.indexOf('</quote>');
quote = messageContent.substring(start + 7, end);
content = messageContent.substring(end + 9);
return [quote, content];
@@ -82,7 +82,7 @@ export function UserMessage(props: {
</div>
</Show>
<Show when={props.message.attachments.length > 0}>
- <div class="flex flex-col flex-wrap justify-end items-end gap-1 w-full px-1 mb-2">
+ <div class="flex flex-col items-end gap-1 ml-auto max-w-[calc(100%-8rem)] mb-2">
<For each={imageAttachments()}>
{(attachment) => (
<ImagePreview
@@ -94,18 +94,21 @@ export function UserMessage(props: {
</For>
<For each={itemPreviewAttachments()}>
{(attachment) => (
- <ItemPreview
- id={attachment.entity_id}
- type={
- (attachment.entity_type === 'email_thread'
- ? 'email'
- : attachment.entity_type) as
- | 'channel'
- | 'document'
- | 'email'
- | 'project'
- }
- />
+ <div class="max-w-full overflow-hidden p-[0.5px]">
+ <ItemPreview
+ id={attachment.entity_id}
+ type={
+ (attachment.entity_type === 'email_thread'
+ ? 'email'
+ : attachment.entity_type) as
+ | 'channel'
+ | 'document'
+ | 'email'
+ | 'project'
+ }
+ class="max-w-full"
+ />
+ </div>
)}
</For>
</div>