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", + }); + }} + > + 引用 + + + ))} );