From 63fa500716e1a1c2380939b8969ddf52b5bcb4b7 Mon Sep 17 00:00:00 2001 From: Henry Li Date: Sun, 18 Jan 2026 20:26:01 +0800 Subject: [PATCH] fix: decode URL --- .../src/components/workspace/artifacts/artifact-file-detail.tsx | 2 +- frontend/src/components/workspace/artifacts/file-viewer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx index a64a063..03b7c0a 100644 --- a/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx +++ b/frontend/src/components/workspace/artifacts/artifact-file-detail.tsx @@ -46,7 +46,7 @@ export function ArtifactFileDetail({ const filepath = useMemo(() => { if (isWriteFile) { const url = new URL(filepathFromProps); - return url.pathname; + return decodeURIComponent(url.pathname); } return filepathFromProps; }, [filepathFromProps, isWriteFile]); diff --git a/frontend/src/components/workspace/artifacts/file-viewer.tsx b/frontend/src/components/workspace/artifacts/file-viewer.tsx index 49b1786..f1ae8a1 100644 --- a/frontend/src/components/workspace/artifacts/file-viewer.tsx +++ b/frontend/src/components/workspace/artifacts/file-viewer.tsx @@ -22,7 +22,7 @@ export function FileViewer({ const { isCodeFile, language } = useMemo(() => { if (isWriteFile) { const url = new URL(filepath); - const path = url.pathname; + const path = decodeURIComponent(url.pathname); return checkCodeFile(path); } return checkCodeFile(filepath);