diff --git a/components/reasoning-workspace.jsx b/components/reasoning-workspace.jsx index 551a7e3..4d29bee 100644 --- a/components/reasoning-workspace.jsx +++ b/components/reasoning-workspace.jsx @@ -686,9 +686,12 @@ export default function ReasoningWorkspace({
{openNodes.map((node) => { const isSelected = selectedPresentationItemId === node.id; + const isFocused = focusedPresentationItemId === node.id; + const hasReasoningSupport = result?.selectedQuestion?.nodeId === node.id && node.id === focusedPresentationItemId; return (
+ {/* One invariant outer shell — same border/padding/position across all states */}
{ if (result?.selectedQuestion?.nodeId !== node.id) { @@ -700,43 +703,123 @@ export default function ReasoningWorkspace({ } }} style={{ cursor: "pointer" }} - className={`w-full text-left rounded-lg px-4 py-3 transition ${ - isSelected - ? "border border-gray-300 bg-white/80 hover:bg-white" - : "border border-gray-200 hover:border-gray-300 hover:bg-white" - }`} + className="w-full text-left rounded-lg border border-gray-200 px-4 py-3 transition hover:border-gray-300 hover:bg-white" > -

+

{node.label}

-
- {isSelected && ( -
-

- We have not explored this yet. Do you want to work through it? -

- -
- )} + {/* Invitation / returned state — one block for both, since isSelected!==isFocused covers both */} + {isSelected && !isFocused && ( +
+

+ We have not explored this yet. Do you want to work through it? +

+ +
+ )} + + {/* Focused state (Work through this clicked) */} + {isFocused && (() => { + const focusedNode = graph?.nodes.find((n) => n.id === node.id); + return ( +
+ {/* Real Engine-backed content — only for matching question */} + {hasReasoningSupport ? ( + <> +
+ Chosen investigation: {" "} + {focusedNode?.label} +
+ + + {updateStatus === "success" && !isUpdating && ( + + )} + + {/* Answer form — only when focused item matches Engine question */} + {!isUpdating && canAnswer && ( +
+
+ +