diff --git a/electron/main/ipc-handlers.ts b/electron/main/ipc-handlers.ts index 0a1a6c7..680a05e 100644 --- a/electron/main/ipc-handlers.ts +++ b/electron/main/ipc-handlers.ts @@ -2356,6 +2356,7 @@ const EXT_MIME_MAP: Record = { '.txt': 'text/plain', '.md': 'text/markdown', '.html': 'text/html', + '.htm': 'text/html', '.css': 'text/css', '.js': 'text/javascript', '.ts': 'text/typescript', diff --git a/src/components/file-preview/ArtifactPanel.tsx b/src/components/file-preview/ArtifactPanel.tsx index 02ce725..9db56af 100644 --- a/src/components/file-preview/ArtifactPanel.tsx +++ b/src/components/file-preview/ArtifactPanel.tsx @@ -16,7 +16,7 @@ * `useArtifactPanel` zustand store so any part of the page (file cards, * toolbar buttons, "View file changes →" links) can drive it. */ -import { useLayoutEffect, useMemo } from 'react'; +import { useLayoutEffect, useMemo, useRef } from 'react'; import { Eye, FileEdit, FolderOpen, FolderTree, X } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { toast } from 'sonner'; @@ -62,7 +62,7 @@ export function ArtifactPanel({ files, agent, runStartedAt, refreshSignal }: Art return (
-
+
{richFocusedFile ? (
-
- {visibleTab === 'changes' && ( +
+
setFocusedFile(f)} + active={visibleTab === 'changes'} /> - )} - {visibleTab === 'preview' && } - {WORKSPACE_BROWSER_ENABLED && visibleTab === 'browser' && ( - +
+
+ +
+ {WORKSPACE_BROWSER_ENABLED && ( +
+ +
)}
@@ -141,13 +146,27 @@ interface PanelTabButtonProps { } function PanelTabButton({ testId, icon, label, active, onClick }: PanelTabButtonProps) { + const pointerActivated = useRef(false); + return (