diff --git a/components/reasoning-workspace.jsx b/components/reasoning-workspace.jsx index c994cc2..13a632a 100644 --- a/components/reasoning-workspace.jsx +++ b/components/reasoning-workspace.jsx @@ -866,6 +866,10 @@ export default function ReasoningWorkspace({ const [focusedPresentationItemId, setFocusedPresentationItemId] = useState(null); const [doneForNowIds, setDoneForNowIds] = useState([]); + // ── RTO.29D — post-Analyse initial reflection surface ───────── + const [initialReflectionActive, setInitialReflectionActive] = useState(false); + const [postAnalyseStatus, setPostAnalyseStatus] = useState(null); + const { saveSession, loadSession } = useSessionPersistence(); // Persist workspace state on every successful update (Phase 3) @@ -1110,6 +1114,28 @@ export default function ReasoningWorkspace({ const hasCurrentSummaryCondition = Boolean(propUnderstanding || graph?.currentSummary || result?.updatedSituationGraph?.currentSummary) || !hasSelectedQuestion; + // ── RTO.29D — manage initial reflection lifecycle ──────────── + useEffect(() => { + const entering = status === "success" && hasGraph && propUnderstanding && !hasSelectedQuestion; + if (entering) { + setPostAnalyseStatus("success"); + setInitialReflectionActive(true); + } else if (!entering && initialReflectionActive) { + // Leave initial reflection when something changes (user interacts, status shifts) + setInitialReflectionActive(false); + setPostAnalyseStatus(null); + } + }, [status, result, hasGraph]); + + // Deactivate initial reflection when user does anything meaningful + useEffect(() => { + if (!initialReflectionActive) return; + if (selectedPresentationItemId || focusedPresentationItemId || investigationHistory.length > 0 || formulationStep !== "idle" || processingStep !== "idle") { + setInitialReflectionActive(false); + setPostAnalyseStatus(null); + } + }, [selectedPresentationItemId, focusedPresentationItemId, investigationHistory, formulationStep, processingStep]); + return (
{/* ── Loading overlays ─────────────────────────────── */} @@ -1150,6 +1176,46 @@ export default function ReasoningWorkspace({
) : ( <> + {/* ── RTO.29D — initial post-Analyse reflection ──────── */} + {postAnalyseStatus === "success" && ( +
+ {/* What I understood */} +
+

+ What I understood +

+

{propUnderstanding}

+
+ + {/* Initial proposed findings */} +
+

+ Initial proposed findings +

+ {(() => { + const resolvedIds = new Set(graph?.resolvedNodeIds || []); + return ( + graph?.nodes?.map((node) => + node.kind === "unknown" && node.status !== "resolved" && !resolvedIds.has(node.id) ? ( + + ) : null, + ) || [] + ); + })()} +
+
+ )} + {/* ── Workspace grid: persistent whenever a graph exists ─── */} {(hasGraph || experimentalBranches) && (
@@ -1219,7 +1285,9 @@ export default function ReasoningWorkspace({ {/* Supporting context within conversation lane */} {hasCurrentSummaryCondition && ( <> - + {postAnalyseStatus !== "success" && ( + + )} {/* ── Experiment 12: progress panel A / B / C toggle (temporary experimental UI) — de-emphasised by branch-as-context experiment RTO.25D */} {hasGraph && (
@@ -1291,7 +1359,7 @@ export default function ReasoningWorkspace({

)} - {graph && } + {graph && postAnalyseStatus !== "success" && } {/* RTO.25B — temporarily hidden to reduce competing navigation while branch-experiment is active */}
diff --git a/components/scenario-form.jsx b/components/scenario-form.jsx index 6c45bcd..416f1f8 100644 --- a/components/scenario-form.jsx +++ b/components/scenario-form.jsx @@ -852,23 +852,25 @@ export default function ScenarioForm() { })()}
- {/* Branch switcher (1/4 sidebar) */} -
- { - if (id === activeBranchId) return; - // Reopen: if the selected branch is paused, clear its pause state - if (doneForNowBranchIds.includes(id)) { - setDoneForNowBranchIds(prev => prev.filter(x => x !== id)); - } - setActiveBranchId(id); - }} - /> -
+ {/* Branch switcher (1/4 sidebar) — suppressed during initial reflection */} + {!((status === "success" && result?.situationGraph && !result?.selectedQuestion)) && ( +
+ { + if (id === activeBranchId) return; + // Reopen: if the selected branch is paused, clear its pause state + if (doneForNowBranchIds.includes(id)) { + setDoneForNowBranchIds(prev => prev.filter(x => x !== id)); + } + setActiveBranchId(id); + }} + /> +
+ )}
)}