Commit 225756d5 by luoqi

feat(web): 召回归因调试-证据链面板加全屏按钮

为什么召·证据链(T0)面板右上角加全屏切换(Maximize2/Minimize2);CSS 固定覆盖式全屏(fixed inset-0 z-50,内容区 overflow-auto 可滚),Esc 退出。便于看长 JSON 原始报文。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
parent 0c04e0b5
...@@ -6,6 +6,7 @@ import { Badge } from '@/components/ui/badge'; ...@@ -6,6 +6,7 @@ import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input'; import { Input } from '@/components/ui/input';
import { ApiError } from '@/lib/api-client'; import { ApiError } from '@/lib/api-client';
import { Maximize2, Minimize2 } from 'lucide-react';
import { import {
recallDebugApi, recallDebugApi,
type PatientCandidate, type PatientCandidate,
...@@ -239,12 +240,36 @@ function WhyRecalled({ data }: { data: RecallDebugReport }) { ...@@ -239,12 +240,36 @@ function WhyRecalled({ data }: { data: RecallDebugReport }) {
}, [plans]); }, [plans]);
const selected = plans.find((p) => p.planId === selectedId) ?? plans[0] ?? null; const selected = plans.find((p) => p.planId === selectedId) ?? plans[0] ?? null;
// 证据链面板可全屏(CSS 固定覆盖,Esc 退出)
const [fullscreen, setFullscreen] = useState(false);
useEffect(() => {
if (!fullscreen) return;
const onKey = (e: KeyboardEvent) => {
if (e.key === 'Escape') setFullscreen(false);
};
window.addEventListener('keydown', onKey);
return () => window.removeEventListener('keydown', onKey);
}, [fullscreen]);
return ( return (
<Card> <Card
<CardHeader> className={
fullscreen ? 'fixed inset-0 z-50 m-0 flex flex-col overflow-hidden rounded-none' : undefined
}
>
<CardHeader className="flex flex-row items-center justify-between space-y-0">
<CardTitle className="text-base">为什么召 · 证据链(T0)</CardTitle> <CardTitle className="text-base">为什么召 · 证据链(T0)</CardTitle>
<button
type="button"
onClick={() => setFullscreen((v) => !v)}
title={fullscreen ? '退出全屏 (Esc)' : '全屏'}
aria-label={fullscreen ? '退出全屏' : '全屏'}
className="rounded p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground"
>
{fullscreen ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}
</button>
</CardHeader> </CardHeader>
<CardContent className="space-y-4"> <CardContent className={fullscreen ? 'flex-1 space-y-4 overflow-auto' : 'space-y-4'}>
{!hasActivePlan && ( {!hasActivePlan && (
<p className="text-sm text-muted-foreground"> <p className="text-sm text-muted-foreground">
无 active plan。 无 active plan。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment