From 3d5006af48cdb6054bbf14610a19a6243697c97b Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Thu, 16 Apr 2026 15:18:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20artifact=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=94=AF=E6=8C=81=E5=8F=B3=E9=94=AE=E5=BC=95?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artifacts/artifact-file-list.tsx | 148 ++++++++++-------- 1 file changed, 86 insertions(+), 62 deletions(-) diff --git a/frontend/src/components/workspace/artifacts/artifact-file-list.tsx b/frontend/src/components/workspace/artifacts/artifact-file-list.tsx index e03eb67b..5c9d2cd2 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-list.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-list.tsx @@ -10,9 +10,16 @@ import { CardHeader, CardTitle, } from "@/components/ui/card"; +import { + ContextMenu, + ContextMenuContent, + ContextMenuItem, + ContextMenuTrigger, +} from "@/components/ui/context-menu"; import { urlOfArtifact } from "@/core/artifacts/utils"; import { useI18n } from "@/core/i18n/hooks"; import { installSkill } from "@/core/skills/api"; +import { dispatchMentionReference } from "@/core/threads/reference-events"; import { getFileExtensionDisplayName, getFileIcon, @@ -78,69 +85,86 @@ export function ArtifactFileList({ data-testid="artifact-file-list" > {files.map((file) => ( - handleClick(file)} - > - - -
- {truncateMiddle(getFileName(file), 50)} -
-
-
- {getFileIcon(file, "size-9 stroke-[1px] stroke-[#333333]")} -
- - {getFileExtensionDisplayName(file)} file - - - {file.endsWith(".skill") && ( - - )} - {threadId ? ( - e.stopPropagation()} - > - - - ) : ( - - )} - -
-
+ {truncateMiddle(getFileName(file), 50)} + + +
+ {getFileIcon(file, "size-9 stroke-[1px] stroke-[#333333]")} +
+ + {getFileExtensionDisplayName(file)} file + + + {file.endsWith(".skill") && ( + + )} + {threadId ? ( + e.stopPropagation()} + > + + + ) : ( + + )} + + + + + + { + dispatchMentionReference({ + threadId, + filename: getFileName(file), + path: file, + ref_source: "artifact", + }); + }} + > + 引用 + + + ))} );