diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 488285fb..68b53dea 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -8,6 +8,7 @@ import { CostIndicator } from "./CostIndicator"; import { KeyboardShortcutsDialog } from "./KeyboardShortcutsDialog"; import { WorkflowBrowserModal } from "./WorkflowBrowserModal"; import { LANGUAGE_OPTIONS, useI18n } from "@/i18n"; +import { isBrowserFileSystemPath } from "@/utils/browserFileSystem"; function CommentsNavigationIcon() { const { t } = useI18n(); @@ -137,6 +138,10 @@ export function Header() { const handleOpenDirectory = async () => { if (!saveDirectoryPath) return; + if (isBrowserFileSystemPath(saveDirectoryPath)) { + alert(t("header.openFolderFailed", { error: "Browser-selected folders cannot be opened from the server." })); + return; + } try { const response = await fetch("/api/open-directory", { @@ -261,7 +266,7 @@ export function Header() { )} - {saveDirectoryPath && ( + {saveDirectoryPath && !isBrowserFileSystemPath(saveDirectoryPath) && (