Feature/product platform foundation v0.62 #1

Merged
robbond merged 683 commits from feature/product-platform-foundation-v0.62 into feature/emergent-unknowns-v0.5 2026-09-09 07:58:20 +01:00
Showing only changes of commit 4761d07a76 - Show all commits
+17 -10
View File
@@ -237,16 +237,9 @@ export default function ScenarioForm() {
const branchScoped = useBranchScopedFixture();
// Toggle to control when the experiment view is visible vs production
const [showExperimentView, setShowExperimentView] = useState(
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,
);
// Always start false for SSR-safe deterministic first render.
// sessionStorage reads are deferred to useEffect (after mount).
const [showExperimentView, setShowExperimentView] = useState(false);
// Use fixture branches as the authoritative source when available
const BRANCHES = useMemo(() => branchScoped.getBranches(), [branchScoped]);
@@ -309,6 +302,20 @@ export default function ScenarioForm() {
setStatus("success");
}, []);
/* Restore experiment view preference from storage (after hydration) ─ */
useEffect(() => {
if (typeof window === "undefined") return;
const savedExp = sessionStorage?.getItem("ce-show-experiment");
if (savedExp === "true") {
setShowExperimentView(true);
return;
}
const session = getSession();
if (session?.situationGraph) {
setShowExperimentView(true);
}
}, []);
/* Restore facilitator dismiss preference (Experiment 05) ─── */
useEffect(() => {
if (typeof window === "undefined") return;