feat(confidence-engine): v0.59b-c — report freshness on Report page + Portfolio
v0.59b — Report page freshness UI: - Shows Current / Update available beside the generated report - Manual Update report action with duplicate prevention guard - Explanation copy about investigation changes since generation - Persists generatedFromRevision during update flow v0.59c — Portfolio Report freshness state: - Surfaces Current / Update available alongside existing View report link - Derives solely from revision provenance (zero model calls) - No Update report action on Portfolio (manual update owned by Report page) - Neither state shown when no Report exists - Updated makeSnapshot with investigationRevision for realistic test data
This commit is contained in:
+23
-6
@@ -18,6 +18,11 @@ function Portfolio() {
|
||||
existing?.investigationReport && existing.investigationReport.understanding
|
||||
);
|
||||
|
||||
const reportIsCurrent =
|
||||
hasReport &&
|
||||
existing.investigationReport.generatedFromRevision ===
|
||||
(existing.investigationRevision ?? 0);
|
||||
|
||||
return (
|
||||
<main className="mx-auto max-w-[640px] px-6 py-16">
|
||||
<h1 className="mb-2 text-3xl font-bold tracking-tight">Confidence Engine</h1>
|
||||
@@ -39,12 +44,24 @@ function Portfolio() {
|
||||
|
||||
<div className="mt-4 flex gap-3 text-sm">
|
||||
{hasReport ? (
|
||||
<Link
|
||||
href={`/investigations/${INVESTIGATION_ID}/report`}
|
||||
className="rounded-lg border border-teal-600 bg-white px-4 py-2 font-medium text-teal-700 hover:bg-teal-50 transition"
|
||||
>
|
||||
View report
|
||||
</Link>
|
||||
<div className="flex items-center gap-2">
|
||||
<Link
|
||||
href={`/investigations/${INVESTIGATION_ID}/report`}
|
||||
className="rounded-lg border border-teal-600 bg-white px-4 py-2 font-medium text-teal-700 hover:bg-teal-50 transition"
|
||||
>
|
||||
View report
|
||||
</Link>
|
||||
|
||||
{reportIsCurrent ? (
|
||||
<span className="text-[11px] font-semibold tracking-wider uppercase text-teal-700/70">
|
||||
Current
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-[11px] font-semibold tracking-wider uppercase text-gray-500">
|
||||
Update available
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user