Skip to content

Commit f2653ed

Browse files
feat(sessions): use Tooltip for execute command title (#3276)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 987883e commit f2653ed

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

packages/ui/src/features/sessions/components/session-update/ExecuteToolView.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Terminal } from "@phosphor-icons/react";
22
import { compactHomePath } from "@posthog/shared";
3+
import { Tooltip } from "@posthog/ui/primitives/Tooltip";
34
import { useChatThreadChrome } from "../chat-thread/chatThreadChrome";
45
import { ToolRow } from "./ToolRow";
56
import {
@@ -51,6 +52,12 @@ export function ExecuteToolView({
5152
);
5253
const hasOutput = output.trim().length > 0;
5354

55+
const commandTooltip = (
56+
<span className="block max-w-md whitespace-pre-wrap break-all font-mono text-xs">
57+
{compactHomePath(command)}
58+
</span>
59+
);
60+
5461
return (
5562
<ToolRow
5663
icon={Terminal}
@@ -64,18 +71,19 @@ export function ExecuteToolView({
6471
{command &&
6572
(chatChrome ? (
6673
<ToolTitle className="min-w-0 shrink truncate font-mono">
67-
<span className="block truncate" title={command}>
68-
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
69-
</span>
74+
<Tooltip content={commandTooltip}>
75+
<span className="block truncate">
76+
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
77+
</span>
78+
</Tooltip>
7079
</ToolTitle>
7180
) : (
7281
<ToolTitle className="min-w-0 shrink truncate">
73-
<span
74-
className="block truncate border border-border bg-gray-5 font-mono"
75-
title={command}
76-
>
77-
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
78-
</span>
82+
<Tooltip content={commandTooltip}>
83+
<span className="block truncate border border-border bg-gray-5 font-mono">
84+
{truncateText(compactHomePath(command), MAX_COMMAND_LENGTH)}
85+
</span>
86+
</Tooltip>
7987
</ToolTitle>
8088
))}
8189
</ToolRow>

0 commit comments

Comments
 (0)