diff --git a/surfsense_web/components/assistant-ui/user-message.tsx b/surfsense_web/components/assistant-ui/user-message.tsx index 019a72343..c01e8e486 100644 --- a/surfsense_web/components/assistant-ui/user-message.tsx +++ b/surfsense_web/components/assistant-ui/user-message.tsx @@ -1,6 +1,6 @@ -import { ActionBarPrimitive, MessagePrimitive, useAuiState } from "@assistant-ui/react"; +import { ActionBarPrimitive, AuiIf, MessagePrimitive, useAuiState } from "@assistant-ui/react"; import { useAtomValue } from "jotai"; -import { FileText, Pen } from "lucide-react"; +import { CheckIcon, CopyIcon, FileText, Pen } from "lucide-react"; import Image from "next/image"; import { type FC, useState } from "react"; import { messageDocumentsMapAtom } from "@/atoms/chat/mentioned-documents.atom"; @@ -54,43 +54,39 @@ export const UserMessage: FC = () => { return ( -
-
- {/* Display mentioned documents */} - {mentionedDocs && mentionedDocs.length > 0 && ( -
- {/* Mentioned documents as chips */} - {mentionedDocs?.map((doc) => ( - - - {doc.title} - - ))} -
- )} - {/* Message bubble with action bar positioned relative to it */} -
+
+
+
+ {mentionedDocs && mentionedDocs.length > 0 && ( +
+ {mentionedDocs?.map((doc) => ( + + + {doc.title} + + ))} +
+ )}
-
+
+ {author && ( +
+ +
+ )}
- {/* User avatar - only shown in shared chats */} - {author && ( -
- -
- )}
); @@ -122,13 +118,21 @@ const UserActionBar: FC = () => { return ( - {/* Only allow editing the last user message */} + + + message.isCopied}> + + + !message.isCopied}> + + + + {canEdit && ( - +