From 867749d7a35896bbcd2670e9cd07615a90377024 Mon Sep 17 00:00:00 2001 From: Henry Li Date: Mon, 2 Feb 2026 10:02:31 +0800 Subject: [PATCH] feat: add file icons --- .../src/app/workspace/chats/[thread_id]/page.tsx | 2 +- .../components/ai-elements/chain-of-thought.tsx | 5 ++++- .../workspace/artifacts/artifact-file-list.tsx | 2 +- .../components/workspace/artifacts/context.tsx | 4 +++- frontend/src/core/utils/files.tsx | 16 ++++++++++++++-- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/workspace/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/chats/[thread_id]/page.tsx index 1f9cd26..6f9db87 100644 --- a/frontend/src/app/workspace/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/chats/[thread_id]/page.tsx @@ -229,7 +229,7 @@ export default function ChatPage() { )} -
+
; export const ChainOfThoughtSearchResults = memo( ({ className, ...props }: ChainOfThoughtSearchResultsProps) => (
), diff --git a/frontend/src/components/workspace/artifacts/artifact-file-list.tsx b/frontend/src/components/workspace/artifacts/artifact-file-list.tsx index 844545b..afcde02 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-list.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-list.tsx @@ -83,7 +83,7 @@ export function ArtifactFileList({
{getFileName(file)}
- {getFileIcon(file)} + {getFileIcon(file, "size-6")}
diff --git a/frontend/src/components/workspace/artifacts/context.tsx b/frontend/src/components/workspace/artifacts/context.tsx index 2428d86..22ccb1d 100644 --- a/frontend/src/components/workspace/artifacts/context.tsx +++ b/frontend/src/components/workspace/artifacts/context.tsx @@ -37,7 +37,9 @@ export function ArtifactsProvider({ children }: ArtifactsProviderProps) { const select = (artifact: string, autoSelect = false) => { setSelectedArtifact(artifact); - setSidebarOpen(false); + if (env.NEXT_PUBLIC_STATIC_WEBSITE_ONLY !== "true") { + setSidebarOpen(false); + } if (!autoSelect) { setAutoSelect(false); } diff --git a/frontend/src/core/utils/files.tsx b/frontend/src/core/utils/files.tsx index 8f9b52f..652e132 100644 --- a/frontend/src/core/utils/files.tsx +++ b/frontend/src/core/utils/files.tsx @@ -5,6 +5,7 @@ import { FileCogIcon, FilePlayIcon, FileTextIcon, + ImageIcon, } from "lucide-react"; const extensionMap: Record = { @@ -191,17 +192,28 @@ export function getFileExtensionDisplayName(filepath: string) { } } -export function getFileIcon(filepath: string) { +export function getFileIcon(filepath: string, className?: string) { const extension = getFileExtension(filepath); const { isCodeFile } = checkCodeFile(filepath); - const className = "size-6"; switch (extension) { case "skill": return ; case "html": return ; + case "txt": case "md": return ; + case "jpg": + case "jpeg": + case "png": + case "gif": + case "bmp": + case "tiff": + case "ico": + case "webp": + case "svg": + case "heic": + return ; case "mp3": case "wav": case "ogg":