feat: adjust tooltips

This commit is contained in:
Henry Li
2026-02-02 09:32:18 +08:00
parent 076c1f0985
commit 0091da1aee
5 changed files with 16 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ function TooltipContent({
data-slot="tooltip-content"
sideOffset={sideOffset ?? 4}
className={cn(
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-background text-foreground z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md border px-3 py-1.5 text-xs text-balance shadow-xs",
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-foreground text-background dark:text-foreground z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md border px-3 py-1.5 text-xs text-balance shadow-xs dark:border-white/18 dark:bg-[#050504]",
className,
)}
{...props}

View File

@@ -320,7 +320,13 @@ function ToolCall({
return (
<ChainOfThoughtStep key={id} label={description} icon={BookOpenTextIcon}>
{path && (
<Tooltip content={<pre>{result as string}</pre>}>
<Tooltip
content={
<pre className="max-w-[95vw] whitespace-pre-wrap">
{result as string}
</pre>
}
>
<ChainOfThoughtSearchResult className="cursor-pointer">
{path}
</ChainOfThoughtSearchResult>
@@ -363,7 +369,11 @@ function ToolCall({
}}
>
{path && (
<ChainOfThoughtSearchResult>{path}</ChainOfThoughtSearchResult>
<Tooltip content={t.toolCalls.clickToViewContent}>
<ChainOfThoughtSearchResult className="cursor-pointer">
{path}
</ChainOfThoughtSearchResult>
</Tooltip>
)}
</ChainOfThoughtStep>
);

View File

@@ -125,6 +125,7 @@ export const enUS: Translations = {
listFolder: "List folder",
readFile: "Read file",
writeFile: "Write file",
clickToViewContent: "Click to view file content",
writeTodos: "Update to-do list",
skillInstallTooltip: "Install skill and make it available to DeerFlow",
},

View File

@@ -118,6 +118,7 @@ export interface Translations {
listFolder: string;
readFile: string;
writeFile: string;
clickToViewContent: string;
writeTodos: string;
skillInstallTooltip: string;
};

View File

@@ -122,6 +122,7 @@ export const zhCN: Translations = {
listFolder: "列出文件夹",
readFile: "读取文件",
writeFile: "写入文件",
clickToViewContent: "点击查看文件内容",
writeTodos: "更新 To-do 列表",
skillInstallTooltip: "安装技能并使其可在 DeerFlow 中使用",
},