diff --git a/src/app/(dashboard)/dashboard/compression/studio/PlayView.tsx b/src/app/(dashboard)/dashboard/compression/studio/PlayView.tsx index fd5b102fba..d7bc933217 100644 --- a/src/app/(dashboard)/dashboard/compression/studio/PlayView.tsx +++ b/src/app/(dashboard)/dashboard/compression/studio/PlayView.tsx @@ -7,6 +7,8 @@ import { PlaygroundInput, LANE_ENGINES } from "./PlaygroundInput"; export interface PlayViewProps { text: string; onText: (t: string) => void; laneEngines?: readonly string[]; } function laneStatus(l: Lane): string { + const rejected = l.run?.steps?.find((s) => s.rejected); + if (rejected) return `⚠ rejeitado: ${rejected.rejectReason ?? ""}`; return l.error ? "⚠ erro" : l.run ? `−${l.run.savingsPercent}%` : "—"; } @@ -31,15 +33,16 @@ function LaneList({ lanes, onSelect }: { lanes: Lane[]; onSelect: (e: string) => export function PlayView({ text, onText, laneEngines = LANE_ENGINES }: PlayViewProps) { const [active, setActive] = useState(["rtk", "caveman"]); const [selectedLane, setSelectedLane] = useState(null); + const [fidelityGate, setFidelityGate] = useState(false); const { batch, loading, run } = usePreviewCompression(); const messages = [{ role: "user", content: text }]; const toggle = (e: string) => setActive((a) => (a.includes(e) ? a.filter((x) => x !== e) : [...a, e])); - const onRun = () => run({ messages, laneEngines: [...laneEngines], activeEngines: orderByStack(active, laneEngines) }); + const onRun = () => run({ messages, laneEngines: [...laneEngines], activeEngines: orderByStack(active, laneEngines), fidelityGate }); const activeDiff = resolveActiveDiff(batch, selectedLane); return (
- + setFidelityGate((v) => !v)} />
{batch?.combined && ( diff --git a/src/app/(dashboard)/dashboard/compression/studio/PlaygroundInput.tsx b/src/app/(dashboard)/dashboard/compression/studio/PlaygroundInput.tsx index d960c1e41b..21cd107173 100644 --- a/src/app/(dashboard)/dashboard/compression/studio/PlaygroundInput.tsx +++ b/src/app/(dashboard)/dashboard/compression/studio/PlaygroundInput.tsx @@ -1,7 +1,7 @@ "use client"; export const LANE_ENGINES = ["session-dedup", "ccr", "lite", "rtk", "headroom", "caveman", "aggressive", "ultra"] as const; -export interface PlaygroundInputProps { text: string; onText: (t: string) => void; active: string[]; onToggleActive: (engine: string) => void; onRun: () => void; loading: boolean; } -export function PlaygroundInput({ text, onText, active, onToggleActive, onRun, loading }: PlaygroundInputProps) { +export interface PlaygroundInputProps { text: string; onText: (t: string) => void; active: string[]; onToggleActive: (engine: string) => void; onRun: () => void; loading: boolean; fidelityGate: boolean; onToggleFidelity: () => void; } +export function PlaygroundInput({ text, onText, active, onToggleActive, onRun, loading, fidelityGate, onToggleFidelity }: PlaygroundInputProps) { return (