mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: show message action tooltips at bottom on agents page (#24041)
The CopyButton tooltip on `/agents` defaulted to top (Radix default),
while the Edit button already used `side="bottom"`. This adds an
optional `tooltipSide` prop to `CopyButton` and passes `"bottom"` in the
agents `ConversationTimeline` so both tooltips appear below the buttons
consistently.
## Changes
- `CopyButton`: added optional `tooltipSide` prop, forwarded to
`<TooltipContent side={tooltipSide}>`
- `ConversationTimeline`: passed `tooltipSide="bottom"` to the
copy-message `CopyButton`
> Generated by Coder Agents
This commit is contained in:
@@ -12,11 +12,13 @@ import { useClipboard } from "#/hooks/useClipboard";
|
||||
type CopyButtonProps = ButtonProps & {
|
||||
text: string;
|
||||
label: string;
|
||||
tooltipSide?: "top" | "bottom" | "left" | "right";
|
||||
};
|
||||
|
||||
export const CopyButton: FC<CopyButtonProps> = ({
|
||||
text,
|
||||
label,
|
||||
tooltipSide,
|
||||
...buttonProps
|
||||
}) => {
|
||||
const { showCopiedSuccess, copyToClipboard } = useClipboard();
|
||||
@@ -34,7 +36,7 @@ export const CopyButton: FC<CopyButtonProps> = ({
|
||||
<span className="sr-only">{label}</span>
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{label}</TooltipContent>
|
||||
<TooltipContent side={tooltipSide}>{label}</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -643,6 +643,7 @@ const ChatMessageItem = memo<{
|
||||
text={parsed.markdown}
|
||||
label="Copy message"
|
||||
className="size-6"
|
||||
tooltipSide="bottom"
|
||||
/>
|
||||
)}
|
||||
{isUser && onEditUserMessage && (
|
||||
|
||||
Reference in New Issue
Block a user