fix(x): show message copy button in side-pane chat

The side-pane copilot renders messages through its own markup in
chat-sidebar.tsx, which never got the hover copy button added to the
full-screen chat renderer. Maximizing the pane stays on the same code
path, so it was missing there too.
This commit is contained in:
Gagan 2026-07-10 01:21:44 +05:30
parent 45d9002a3a
commit a090385f34

View file

@ -21,6 +21,7 @@ import {
import {
Message,
MessageContent,
MessageCopyButton,
MessageResponse,
} from '@/components/ai-elements/message'
import { TurnActivityIndicator } from '@/components/turn-activity-indicator'
@ -416,14 +417,17 @@ export function ChatSidebar({
<ChatMessageAttachments attachments={item.attachments} />
</MessageContent>
{item.content && (
<MessageContent>
<MessageResponse
components={streamdownComponents}
remarkPlugins={userMessageRemarkPlugins}
>
{item.content}
</MessageResponse>
</MessageContent>
<div className="flex flex-col items-end">
<MessageContent>
<MessageResponse
components={streamdownComponents}
remarkPlugins={userMessageRemarkPlugins}
>
{item.content}
</MessageResponse>
</MessageContent>
<MessageCopyButton text={item.content} className="mt-0.5" />
</div>
)}
</Message>
)
@ -431,26 +435,29 @@ export function ChatSidebar({
const { message, files } = parseAttachedFiles(item.content)
return (
<Message key={item.id} from={item.role} data-message-id={item.id}>
<MessageContent>
{files.length > 0 && (
<div className="mb-2 flex flex-wrap gap-1.5">
{files.map((filePath, index) => (
<span
key={index}
className="inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary"
>
@{wikiLabel(filePath)}
</span>
))}
</div>
)}
<MessageResponse
components={streamdownComponents}
remarkPlugins={userMessageRemarkPlugins}
>
{message}
</MessageResponse>
</MessageContent>
<div className="flex flex-col items-end">
<MessageContent>
{files.length > 0 && (
<div className="mb-2 flex flex-wrap gap-1.5">
{files.map((filePath, index) => (
<span
key={index}
className="inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary"
>
@{wikiLabel(filePath)}
</span>
))}
</div>
)}
<MessageResponse
components={streamdownComponents}
remarkPlugins={userMessageRemarkPlugins}
>
{message}
</MessageResponse>
</MessageContent>
<MessageCopyButton text={message} className="mt-0.5" />
</div>
</Message>
)
}