Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions apps/code/src/renderer/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ export function CodeBlock({ children, size = "1" }: CodeBlockProps) {
variant="ghost"
color="gray"
onClick={handleCopy}
style={{
transition: "opacity 0.15s",
}}
className="group-hover:!opacity-100 [&]:hover:!opacity-100 absolute top-1 right-1 cursor-pointer opacity-0"
className="absolute top-1 right-1 cursor-pointer"
aria-label="Copy code"
>
{copied ? <Check size={14} /> : <Copy size={14} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,21 @@ export const AgentMessage = memo(function AgentMessage({
}, [content]);

return (
<Box className="group/msg relative py-1 pl-3 text-[13px] [&>*:last-child]:mb-0">
<MarkdownRenderer
content={content}
componentsOverride={agentComponents}
/>
<Box className="absolute top-1 right-1 opacity-0 transition-opacity group-hover/msg:opacity-100">
<Box className="py-1 pl-3 text-[13px]">
<div className="[&>*:last-child]:mb-0">
<MarkdownRenderer
content={content}
componentsOverride={agentComponents}
/>
</div>
<Box className="flex justify-end pt-1">
<Tooltip content={copied ? "Copied!" : "Copy message"}>
<IconButton
size="1"
variant="ghost"
color={copied ? "green" : "gray"}
onClick={handleCopy}
aria-label="Copy message"
>
{copied ? <Check size={12} /> : <Copy size={12} />}
</IconButton>
Expand Down
Loading