Hide copy button unless useful
This commit is contained in:
parent
d8bd310854
commit
ddf6d996c4
@ -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).
|
||||
|
@ -286,7 +286,8 @@ const Conversation = forwardRef<ConversationHandle, ConversationProps>(({
|
||||
{
|
||||
role: 'user',
|
||||
origin: type,
|
||||
content: query
|
||||
content: query,
|
||||
disableCopy: true
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
@ -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) => {
|
||||
}
|
||||
</CardContent>
|
||||
<CardActions disableSpacing sx={{ display: "flex", flexDirection: "row", justifyContent: "space-between", alignItems: "center", width: "100%", p: 0, m: 0 }}>
|
||||
<CopyBubble content={message?.content} />
|
||||
{message.disableCopy === undefined && ["assistant", "content"].includes(message.role) && <CopyBubble content={message.content} />}
|
||||
{message.metadata && (
|
||||
<Box sx={{ display: "flex", alignItems: "center", gap: 1 }}>
|
||||
<Button variant="text" onClick={handleExpandClick} sx={{ color: "darkgrey", p: 0 }}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user