test(ui): explore branch as workspace context
This commit is contained in:
@@ -521,6 +521,7 @@ export default function ReasoningWorkspace({
|
|||||||
onAnswerSubmit,
|
onAnswerSubmit,
|
||||||
lastSubmittedAnswer,
|
lastSubmittedAnswer,
|
||||||
onRestart,
|
onRestart,
|
||||||
|
branchContext,
|
||||||
}) {
|
}) {
|
||||||
const [investigationHistory, setInvestigationHistory] = useState([]);
|
const [investigationHistory, setInvestigationHistory] = useState([]);
|
||||||
const turnCounter = useRef(0);
|
const turnCounter = useRef(0);
|
||||||
@@ -823,6 +824,21 @@ export default function ReasoningWorkspace({
|
|||||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
<div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
|
||||||
{/* ── Left lane: active conversation & notebook ───────── */}
|
{/* ── Left lane: active conversation & notebook ───────── */}
|
||||||
<div className="space-y-6 lg:col-span-2">
|
<div className="space-y-6 lg:col-span-2">
|
||||||
|
{/* Active branch context (experiment RTO.25D) */}
|
||||||
|
{branchContext && hasGraph && (
|
||||||
|
<div className="rounded-lg border border-blue-200/60 bg-blue-50/40 px-5 py-4">
|
||||||
|
<h2 className="mb-1 text-[11px] font-semibold tracking-widest uppercase text-gray-500">
|
||||||
|
Current branch
|
||||||
|
</h2>
|
||||||
|
<p className="text-base font-medium leading-tight text-gray-900">{branchContext.label}</p>
|
||||||
|
{branchContext.origin && (
|
||||||
|
<p className="mt-2 text-sm leading-relaxed text-gray-600">
|
||||||
|
Trying to understand: {branchContext.origin}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* ── Open questions (case workspace) — no ranking bias ── */}
|
{/* ── Open questions (case workspace) — no ranking bias ── */}
|
||||||
{(() => {
|
{(() => {
|
||||||
const openNodes = graph.nodes.filter(
|
const openNodes = graph.nodes.filter(
|
||||||
@@ -1104,9 +1120,9 @@ export default function ReasoningWorkspace({
|
|||||||
{hasCurrentSummaryCondition && (
|
{hasCurrentSummaryCondition && (
|
||||||
<>
|
<>
|
||||||
<CurrentUnderstandingCard currentSummary={graph?.currentSummary || result?.updatedSituationGraph?.currentSummary} plainLanguage={propUnderstanding || null} />
|
<CurrentUnderstandingCard currentSummary={graph?.currentSummary || result?.updatedSituationGraph?.currentSummary} plainLanguage={propUnderstanding || null} />
|
||||||
{/* ── Experiment 12: progress panel A / B / C toggle (temporary experimental UI) ── */}
|
{/* ── Experiment 12: progress panel A / B / C toggle (temporary experimental UI) — de-emphasised by branch-as-context experiment RTO.25D */}
|
||||||
{hasGraph && (
|
{hasGraph && (
|
||||||
<div className="space-y-2">
|
<div className="hidden space-y-2">
|
||||||
<div className="flex items-center gap-2" role="radiogroup" aria-label="Progress panel variant">
|
<div className="flex items-center gap-2" role="radiogroup" aria-label="Progress panel variant">
|
||||||
<button
|
<button
|
||||||
role="radio"
|
role="radio"
|
||||||
|
|||||||
@@ -543,24 +543,30 @@ export default function ScenarioForm() {
|
|||||||
<div className="grid grid-cols-1 gap-6 lg:grid-cols-4">
|
<div className="grid grid-cols-1 gap-6 lg:grid-cols-4">
|
||||||
{/* Workspace (3/4) */}
|
{/* Workspace (3/4) */}
|
||||||
<div className="lg:col-span-3">
|
<div className="lg:col-span-3">
|
||||||
<ReasoningWorkspace
|
{/* Build branch context for the active branch */}
|
||||||
scenario={scenario}
|
{(() => {
|
||||||
status={status}
|
const activeBranch = BRANCHES.find(b => b.id === activeBranchId);
|
||||||
updateStatus={updateStatus}
|
const branchContext = activeBranch ? { label: activeBranch.label, origin: activeBranch.origin } : null;
|
||||||
currentUnderstanding={currentUnderstanding}
|
return (
|
||||||
result={{
|
<ReasoningWorkspace
|
||||||
...(result || {}),
|
scenario={scenario}
|
||||||
situationGraph: updateResult?.updatedSituationGraph ?? result?.situationGraph,
|
status={status}
|
||||||
selectedQuestion: updateResult?.selectedQuestion ?? result?.selectedQuestion,
|
updateStatus={updateStatus}
|
||||||
newlySurfacedNodeIds: result?.newlySurfacedNodeIds || [],
|
currentUnderstanding={currentUnderstanding}
|
||||||
diagnostics: result?.diagnostics || null,
|
result={{
|
||||||
updateError,
|
...(result || {}),
|
||||||
}}
|
situationGraph: updateResult?.updatedSituationGraph ?? result?.situationGraph,
|
||||||
answer={answer}
|
selectedQuestion: updateResult?.selectedQuestion ?? result?.selectedQuestion,
|
||||||
setAnswer={setAnswer}
|
newlySurfacedNodeIds: result?.newlySurfacedNodeIds || [],
|
||||||
onAnswerSubmit={handleUpdate}
|
diagnostics: result?.diagnostics || null,
|
||||||
lastSubmittedAnswer={lastSubmittedAnswer}
|
updateError,
|
||||||
onRestart={() => {
|
}}
|
||||||
|
answer={answer}
|
||||||
|
setAnswer={setAnswer}
|
||||||
|
onAnswerSubmit={handleUpdate}
|
||||||
|
lastSubmittedAnswer={lastSubmittedAnswer}
|
||||||
|
branchContext={branchContext}
|
||||||
|
onRestart={() => {
|
||||||
clearSession();
|
clearSession();
|
||||||
setStatus("idle");
|
setStatus("idle");
|
||||||
setResult(null);
|
setResult(null);
|
||||||
@@ -572,7 +578,9 @@ export default function ScenarioForm() {
|
|||||||
setUpdateError(null);
|
setUpdateError(null);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
);
|
||||||
|
})()}
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Branch switcher (1/4 sidebar) */}
|
{/* Branch switcher (1/4 sidebar) */}
|
||||||
<div className="lg:col-span-1">
|
<div className="lg:col-span-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user