test(ui): restore fresh start scenario entry

This commit is contained in:
2026-08-20 09:42:32 +01:00
parent cef8f46bd6
commit 173240d76c
+9 -2
View File
@@ -238,7 +238,14 @@ export default function ScenarioForm() {
const branchScoped = useBranchScopedFixture(); const branchScoped = useBranchScopedFixture();
// Toggle to control when the experiment view is visible vs production // Toggle to control when the experiment view is visible vs production
const [showExperimentView, setShowExperimentView] = useState( const [showExperimentView, setShowExperimentView] = useState(
typeof window !== "undefined" ? (window.sessionStorage?.getItem("ce-show-experiment") !== "false") : true, typeof window !== "undefined" ? (() => {
const saved = sessionStorage?.getItem("ce-show-experiment");
// Only default to true if user explicitly toggled ON (saved === "true")
// or has an active investigation context (session exists with situationGraph)
if (saved === "true") return true;
const session = getSession();
return Boolean(session?.situationGraph);
})() : false,
); );
// Use fixture branches as the authoritative source when available // Use fixture branches as the authoritative source when available
@@ -457,7 +464,7 @@ export default function ScenarioForm() {
return ( return (
<div className="space-y-6"> <div className="space-y-6">
{/* ── RTO.26B — standalone branch-scoped experimental view (shown when experiment is active) ───── */} {/* ── RTO.26B — standalone branch-scoped experimental view (shown when experiment is active) ───── */}
{showExperimentView && status !== "loading" && (result?.situationGraph || status === "success") && ( {showExperimentView && (result?.situationGraph || status === "success") && status !== "loading" && (
<> <>
<PulseStyle /> <PulseStyle />
<div className="grid grid-cols-1 gap-6 lg:grid-cols-4"> <div className="grid grid-cols-1 gap-6 lg:grid-cols-4">