From 96ad0e7915cfec4a928ad5b0721b28d35c1e7417 Mon Sep 17 00:00:00 2001 From: robbond Date: Sat, 22 Aug 2026 19:01:45 +0100 Subject: [PATCH] refine(ui): restore visual hierarchy and Situation context in initial workspace - Enhance Current Understanding prominence with subtle teal/teal border gradient, stronger heading, larger body text, more internal spacing - Restore Situation panel as right-hand column in initial reflection view; uses OriginalSituation when graph exists, scenario text fallback otherwise - Stacks layout on narrow screens via grid-cols-1/gap-6/lg:grid-cols-3 - Apply teal styling to normal-state CurrentUnderstandingCard and PlainLanguageCard (was flat gray border with bg-transparent) - Surface assumption nodes alongside unknowns in Open Questions; add Unclear / Plausible interpretation tags - Wire up follow-up question buttons in deconstructed results --- components/reasoning-workspace.jsx | 145 +++++++++++++++++++++-------- 1 file changed, 107 insertions(+), 38 deletions(-) diff --git a/components/reasoning-workspace.jsx b/components/reasoning-workspace.jsx index 9139f6b..7b09ceb 100644 --- a/components/reasoning-workspace.jsx +++ b/components/reasoning-workspace.jsx @@ -512,11 +512,11 @@ function CurrentUnderstandingCard({ currentSummary, plainLanguage }) { if (!summary) return null; return ( -
-

+
+

Understanding

-

{summary}

+

{summary}

); } @@ -526,11 +526,11 @@ function PlainLanguageCard({ summary }) { if (!summary) return null; return ( -
-

+
+

Understanding

-

{summary}

+

{summary}

); } @@ -710,6 +710,7 @@ function OpenQuestionsPanel({ focused, formulationStep, formulateMsg, processingStep, deconstructMsg, doneForNowIds, startFocused, handleDeconstructSubmit, retryFormulation, setSelectedPresentationItemId, setFocusedPresentationItemId, setFocusedAnswer, focusedAnswer, setDoneForNowIds, + setFollowUpQuestion, }) { const openNodes = (graph?.nodes || []).filter( (n) => n.kind === "unknown" && n.status !== "resolved" && !doneForNowIds.includes(n.id), @@ -785,11 +786,29 @@ function OpenQuestionsPanel({ {focused?.result && ( <> -

What we learned

    {focused.result.observations.map((o, i) => (
  • {o}
  • ))}
-

Still unclear

    {focused.result.uncertainties.map((u, i) => (
  • {u}
  • ))}
- {focused.result.assumptions?.length > 0 &&

Assumptions in this response

    {focused.result.assumptions.map((a, i) => (
  • {a}
  • ))}
} - {focused.result.relationships?.length > 0 &&

Connections

    {focused.result.relationships.map((r, i) => (
  • {r.from} → {r.to} ({r.type})
  • ))}
} - {focused.result.possibleFollowUpQuestions?.length > 0 &&

Questions this raises

    {focused.result.possibleFollowUpQuestions.map((q, i) => (
  • {q}
  • ))}
} +

What this tells us

    {(focused.result.observations || []).map((o, i) => (
  • {o}
  • ))}
+

Still unclear

    {(focused.result.uncertainties || []).map((u, i) => (
  • {u}
  • ))}
+

Assumptions

    {(focused.result.assumptions || []).map((a, i) => (
  • {a}
  • ))}
+

Connections

    {(focused.result.relationships || []).map((r, i) => (
  • {r.from} → {r.to} ({r.type})
  • ))}
+

Questions this raises

+ {(focused.result.possibleFollowUpQuestions || []).length > 0 ? ( +
+ {focused.result.possibleFollowUpQuestions.map((q, i) => ( + + ))} +
+ ) : ( +

None yet

+ )} +
)} @@ -1113,6 +1132,16 @@ export default function ReasoningWorkspace({ doFormulate(target); } + function setFollowUpQuestion(followUpText) { + const target = focusedPresentationItemId; + if (!target || !followUpText?.trim()) return; + setFocusedInvestigations((prev) => ({ + ...prev, + [target]: { ...prev[target], question: followUpText.trim(), answer: null }, + })); + setFocusedAnswer(""); + } + function hasFocusedContent() { if (!focused) return false; const q = focused.question; @@ -1201,40 +1230,79 @@ export default function ReasoningWorkspace({ {/* ── RTO.29D — initial post-Analyse reflection ──────── */} {postAnalyseStatus === "success" && (
- {/* What I understood */} -
-

- What I understood -

-

{propUnderstanding}

-
+ {/* Current Understanding + Situation — prominent two-column orienting surface */} +
+
+ {/* Current Understanding — prominent orienting surface */} +
+

+ Current Understanding +

+

{propUnderstanding}

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

- Initial proposed findings -

+ {/* Initial proposed findings — unknowns + plausible interpretations from reconstruction */} +
+

+ Open Questions +

{(() => { const resolvedIds = new Set(graph?.resolvedNodeIds || []); + // Surface only candidate items from the semantic reconstruction that are worth investigating: + // — unknowns (importantUnknowns from the LLM's reconstruction) + // — assumptions (plausibleInterpretations from the LLM's reconstruction) + // Skips observations, states, relationships, transitions — these are already established facts/context. + // Both kinds check status !== "resolved" and excluded resolvedIds to mirror OpenQuestionsPanel logic. + const candidateKinds = ["unknown", "assumption"]; return ( - graph?.nodes?.map((node) => - node.kind === "unknown" && node.status !== "resolved" && !resolvedIds.has(node.id) ? ( - - ) : null, - ) || [] + (graph?.nodes || []) + .filter( + (n) => + candidateKinds.includes(n.kind) && + n.status !== "resolved" && + !resolvedIds.has(n.id), + ) + .map((node) => { + const tag = node.kind === "assumption" ? "Plausible interpretation" : "Unclear"; + return ( + + ); + }) ); })()}
+
+ + {/* Situation panel during initial reflection */} + {hasGraph && ( +
+ +
+ )} + {!hasGraph && scenario && ( +
+
+

+ Situation +

+

+ {scenario} +

+
+
+ )} +
)} @@ -1269,6 +1337,7 @@ export default function ReasoningWorkspace({ setFocusedAnswer={setFocusedAnswer} focusedAnswer={focusedAnswer} setDoneForNowIds={setDoneForNowIds} + setFollowUpQuestion={setFollowUpQuestion} /> )}