From ddf6d996c4cbdd17e7e4e94563d3dfa8dd5b8991 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sat, 26 Apr 2025 17:25:49 -0700 Subject: [PATCH] Hide copy button unless useful --- frontend/src/App.tsx | 1 + frontend/src/Conversation.tsx | 3 ++- frontend/src/Message.tsx | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9da6ed2..0279555 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -123,6 +123,7 @@ const App = () => { { role: 'content', title: 'Welcome to Backstory', + disableCopy: true, content: ` Backstory is a RAG enabled expert system with access to real-time data running self-hosted (no cloud) versions of industry leading Large and Small Language Models (LLM/SLMs). diff --git a/frontend/src/Conversation.tsx b/frontend/src/Conversation.tsx index 5235b02..83ca2b2 100644 --- a/frontend/src/Conversation.tsx +++ b/frontend/src/Conversation.tsx @@ -286,7 +286,8 @@ const Conversation = forwardRef(({ { role: 'user', origin: type, - content: query + content: query, + disableCopy: true } ]); } diff --git a/frontend/src/Message.tsx b/frontend/src/Message.tsx index 1ce8c81..52801e5 100644 --- a/frontend/src/Message.tsx +++ b/frontend/src/Message.tsx @@ -32,6 +32,7 @@ type MessageRoles = 'info' | 'user' | 'assistant' | 'system' | 'status' | 'error type MessageData = { role: MessageRoles, content: string, + disableCopy?: boolean, user?: string, title?: string, origin?: string, @@ -272,7 +273,7 @@ const Message = (props: MessageProps) => { } - + {message.disableCopy === undefined && ["assistant", "content"].includes(message.role) && } {message.metadata && (