feat: begin responsive workspace layout

This commit is contained in:
2026-08-05 10:51:44 +01:00
parent 2f87cca88d
commit cf05c969bf
4 changed files with 141 additions and 63 deletions
+74 -63
View File
@@ -656,10 +656,10 @@ export default function ReasoningWorkspace({
</div>
) : (
<>
{/* ── Investigation summary card ─────────────── */}
{/* ── Investigation summary card — always full-width ─────────── */}
<InvestigationSummaryPanel graph={graph} selectedQuestion={selectedQ} result={result} updateStatus={updateStatus} />
{/* ── Active investigation context (always visible while question exists) ─ */}
{/* Active workspace — primary focus, full-width column ─────── */}
{hasSelectedQuestion && (
<>
<CurrentInvestigationCard selectedQuestion={selectedQ} graph={graph} />
@@ -669,71 +669,82 @@ export default function ReasoningWorkspace({
{/* Post-update acknowledgement — only after success, never during loading */}
{updateStatus === "success" && !isUpdating && <UpdateAcknowledgement updateResult={result} />}
{/* ── Local update loading (always visible when updating) ─ */}
{isUpdating && (
<LoadingOverlay
isLoading={true}
elapsed={updateElapsed}
currentMessage={updateMsg}
variant="update"
/>
)}
{/* ── Response form — hidden during update loading ─ */}
{!isUpdating && canAnswer && (
<form onSubmit={handleUpdateCaptureAndSubmit} className="space-y-4 rounded-lg border border-gray-200 bg-white p-5">
<div>
<label htmlFor="rw-answer" className="mb-2 block text-sm font-medium text-gray-700">
Response
</label>
<textarea
id="rw-answer"
value={answer}
onChange={(e) => setAnswer(e.target.value)}
rows={4}
disabled={updateStatus === "loading"}
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-sm focus:border-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 disabled:cursor-not-allowed disabled:opacity-60"
placeholder="Enter the answer to the selected question..."
{/* ── Active workspace (left) + Working memory (right) ─────── */}
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
{/* Left column — active workspace */}
<div className="space-y-6">
{/* ── Local update loading (always visible when updating) ─ */}
{isUpdating && (
<LoadingOverlay
isLoading={true}
elapsed={updateElapsed}
currentMessage={updateMsg}
variant="update"
/>
)}
{/* ── Response form — hidden during update loading ─ */}
{!isUpdating && canAnswer && (
<form onSubmit={handleUpdateCaptureAndSubmit} className="space-y-4 rounded-lg border border-gray-200 bg-white p-5">
<div>
<label htmlFor="rw-answer" className="mb-2 block text-sm font-medium text-gray-700">
Response
</label>
<textarea
id="rw-answer"
value={answer}
onChange={(e) => setAnswer(e.target.value)}
rows={4}
disabled={updateStatus === "loading"}
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-sm focus:border-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 disabled:cursor-not-allowed disabled:opacity-60"
placeholder="Enter the answer to the selected question..."
/>
</div>
<div className="flex items-center justify-between">
<p className="text-xs text-gray-400">
One update turn only in this prototype.
</p>
<button
type="submit"
disabled={!answer.trim()}
className="rounded-lg bg-blue-700 px-5 py-2.5 text-sm font-medium text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-40"
>
Update
</button>
</div>
</form>
)}
{/* ── Terminal state: outcome card — hidden during update loading ─ */}
{!isUpdating && status === "success" && !hasSelectedQuestion && graph && genuineCompletion && (
<CompletionCard summary={resolveCurrentSummary(propUnderstanding || graph?.currentSummary || result?.updatedSituationGraph?.currentSummary)} />
)}
{!isUpdating && status === "success" && !hasSelectedQuestion && graph && !genuineCompletion && (
<EvidenceLimitCard summary={resolveCurrentSummary(propUnderstanding || graph?.currentSummary || result?.updatedSituationGraph?.currentSummary)} />
)}
</div>
{/* Right column — working memory: Understanding + Map */}
{hasSelectedQuestion && (
<div className="space-y-6">
{hasCurrentSummaryCondition && (
<CurrentUnderstandingCard currentSummary={graph?.currentSummary || result?.updatedSituationGraph?.currentSummary} plainLanguage={propUnderstanding || null} />
)}
<InvestigationMap turnCount={investigationHistory.length} />
</div>
<div className="flex items-center justify-between">
<p className="text-xs text-gray-400">
One update turn only in this prototype.
</p>
<button
type="submit"
disabled={!answer.trim()}
className="rounded-lg bg-blue-700 px-5 py-2.5 text-sm font-medium text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-40"
>
Update
</button>
</div>
</form>
)}
)}
</div>
{/* ── Terminal state: outcome card — hidden during update loading ─ */}
{!isUpdating && status === "success" && !hasSelectedQuestion && graph && genuineCompletion && (
<CompletionCard summary={resolveCurrentSummary(propUnderstanding || graph?.currentSummary || result?.updatedSituationGraph?.currentSummary)} />
)}
{!isUpdating && status === "success" && !hasSelectedQuestion && graph && !genuineCompletion && (
<EvidenceLimitCard summary={resolveCurrentSummary(propUnderstanding || graph?.currentSummary || result?.updatedSituationGraph?.currentSummary)} />
)}
{/* ── Reference row — Situation + History side-by-side on desktop ─ */}
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
<OriginalSituation scenario={scenario} centralStatement={graph?.centralStatement} />
{investigationHistory.length > 0 && (
<InvestigationHistory turns={investigationHistory} />
)}
</div>
{/* ── Current understanding (active investigation only) ─ */}
{hasCurrentSummaryCondition && hasSelectedQuestion && (
<CurrentUnderstandingCard currentSummary={graph?.currentSummary || result?.updatedSituationGraph?.currentSummary} plainLanguage={propUnderstanding || null} />
)}
{/* ── Investigation Map (visible during active investigation) ─ */}
{hasSelectedQuestion && (
<InvestigationMap turnCount={investigationHistory.length} />
)}
<OriginalSituation scenario={scenario} centralStatement={graph?.centralStatement} />
{investigationHistory.length > 0 && <InvestigationHistory turns={investigationHistory} />}
{/* ── Developer details (collapsed by default) ── */}
{/* ── Developer details (collapsed by default, always below) ─ */}
{(status === "success" || status === "error") && graph && (
<DeveloperDetails
graph={graph}