fix: deduplicate evidence refs in trend summaries

Backend: assemble_trend_with_evidence now deduplicates document IDs
via dict.fromkeys() (the rollup code already did this, but the base
assembly didn't — same doc could appear multiple times from different
intelligence extractions).

Frontend: Trends.tsx deduplicates via Set before rendering as a safety
net for existing data already stored with duplicates.
This commit is contained in:
Celes Renata
2026-04-17 07:25:32 +00:00
parent d243142705
commit 5efccb1e03
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -103,10 +103,10 @@ function TrendCard({ trend, onClick }: { trend: TrendSummary; onClick: () => voi
)}
{expanded && (
<div className="mt-2 space-y-1 text-xs">
{trend.top_supporting_evidence?.map((e, i) => (
{[...new Set(trend.top_supporting_evidence ?? [])].map((e, i) => (
<EvidenceRef key={i} id={e} direction="supporting" />
))}
{trend.top_opposing_evidence?.map((e, i) => (
{[...new Set(trend.top_opposing_evidence ?? [])].map((e, i) => (
<EvidenceRef key={i} id={e} direction="opposing" />
))}
</div>