From a597be92677874f33b65bfa8d9ca0ce6f7321181 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 27 Apr 2026 19:55:32 +0700 Subject: [PATCH] revert(inspect-ui): drop HtmlPanel + html tab Removes the iframe-based HTML viewer and its before/after tab wiring from RunDetail. --- inspect-ui/src/panels/HtmlPanel.css | 60 ------------------------ inspect-ui/src/panels/HtmlPanel.tsx | 73 ----------------------------- inspect-ui/src/routes/RunDetail.tsx | 31 ------------ 3 files changed, 164 deletions(-) delete mode 100644 inspect-ui/src/panels/HtmlPanel.css delete mode 100644 inspect-ui/src/panels/HtmlPanel.tsx diff --git a/inspect-ui/src/panels/HtmlPanel.css b/inspect-ui/src/panels/HtmlPanel.css deleted file mode 100644 index 7e94687..0000000 --- a/inspect-ui/src/panels/HtmlPanel.css +++ /dev/null @@ -1,60 +0,0 @@ -.html-panel { - display: flex; - flex-direction: column; - gap: 8px; -} - -.html-toolbar { - display: flex; - gap: 4px; -} - -.html-tab { - font-family: var(--font-mono); - font-size: 12px; - padding: 2px 10px; - background: var(--surface-1); - border: 1px solid var(--border); - color: var(--text-secondary); - cursor: pointer; -} - -.html-tab-active { - color: var(--text-primary); - border-color: var(--border-strong, var(--border)); -} - -.html-frame { - width: 100%; - height: 480px; - border: 1px solid var(--border); - background: white; -} - -.html-source { - font-family: var(--font-mono); - font-size: 11px; - color: var(--text-primary); - background: var(--surface-1); - border: 1px solid var(--border); - padding: 8px; - margin: 0; - max-height: 480px; - overflow: auto; - white-space: pre-wrap; - word-break: break-all; -} - -.html-empty { - font-family: var(--font-mono); - font-size: 12px; - color: var(--text-secondary); - padding: 16px; -} - -.html-error { - font-family: var(--font-mono); - font-size: 12px; - color: var(--text-violation, #c33); - padding: 16px; -} diff --git a/inspect-ui/src/panels/HtmlPanel.tsx b/inspect-ui/src/panels/HtmlPanel.tsx deleted file mode 100644 index 5155a6c..0000000 --- a/inspect-ui/src/panels/HtmlPanel.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useEffect, useState } from "react"; -import { htmlUrl } from "../api"; -import "./HtmlPanel.css"; - -interface HtmlPanelProps { - runId: string; - fileName: string; - available: boolean; -} - -type ViewMode = "render" | "source"; - -export default function HtmlPanel({ runId, fileName, available }: HtmlPanelProps): JSX.Element { - const [mode, setMode] = useState("render"); - const [source, setSource] = useState(null); - const [error, setError] = useState(null); - const url = htmlUrl(runId, fileName); - - useEffect(() => { - if (!available || mode !== "source") return; - let cancelled = false; - setSource(null); - setError(null); - fetch(url) - .then((response) => { - if (!response.ok) throw new Error(`${response.status} ${response.statusText}`); - return response.text(); - }) - .then((text) => { - if (!cancelled) setSource(text); - }) - .catch((failure: unknown) => { - if (!cancelled) setError(failure instanceof Error ? failure.message : String(failure)); - }); - return () => { - cancelled = true; - }; - }, [available, mode, url]); - - if (!available) { - return
no html captured for this step
; - } - - return ( -
-
- - -
- {mode === "render" ? ( -