Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Terminal } from "@phosphor-icons/react";
import { compactHomePath } from "@posthog/shared";
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
import { useChatThreadChrome } from "../chat-thread/chatThreadChrome";
import { ToolRow } from "./ToolRow";
import {
Expand Down Expand Up @@ -51,6 +52,14 @@ export function ExecuteToolView({
);
const hasOutput = output.trim().length > 0;

// Full command in a wrapping mono block so a truncated row still surfaces
// exactly what ran on hover, however long it is.
const commandTooltip = (
<span className="block max-w-md whitespace-pre-wrap break-all font-mono text-xs">
{command}
</span>
);

return (
<ToolRow
icon={Terminal}
Expand All @@ -64,18 +73,19 @@ export function ExecuteToolView({
{command &&
(chatChrome ? (
<ToolTitle className="min-w-0 shrink truncate font-mono">
<span className="block truncate" title={command}>
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
</span>
<Tooltip content={commandTooltip}>
<span className="block truncate">
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
</span>
</Tooltip>
</ToolTitle>
) : (
<ToolTitle className="min-w-0 shrink truncate">
<span
className="block truncate border border-border bg-gray-5 font-mono"
title={command}
>
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
</span>
<Tooltip content={commandTooltip}>
<span className="block truncate border border-border bg-gray-5 font-mono">
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
</span>
</Tooltip>
</ToolTitle>
))}
</ToolRow>
Expand Down
Loading