diff --git a/frontend/src/pages/Trading.tsx b/frontend/src/pages/Trading.tsx index 500d536..bf47c6d 100644 --- a/frontend/src/pages/Trading.tsx +++ b/frontend/src/pages/Trading.tsx @@ -82,7 +82,7 @@ export function TradingPage() { Override Trade diff --git a/frontend/src/pages/Trends.tsx b/frontend/src/pages/Trends.tsx index b6a46f7..2fead84 100644 --- a/frontend/src/pages/Trends.tsx +++ b/frontend/src/pages/Trends.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; import { useNavigate, Link } from '@tanstack/react-router'; -import { useTrends } from '../api/hooks'; +import { useTrends, useDocument } from '../api/hooks'; import { TrendArrow, ConfidenceBar, LoadingSpinner, TickerFilter, Card } from '../components/ui'; import type { TrendSummary } from '../api/hooks'; @@ -120,6 +120,8 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/ function EvidenceRef({ id, direction }: { id: string; direction: 'supporting' | 'opposing' }) { const sign = direction === 'supporting' ? '+' : '−'; const color = direction === 'supporting' ? 'text-green-400' : 'text-red-400'; + const isUuid = UUID_RE.test(id); + const { data: doc } = useDocument(isUuid ? id : undefined); // Pattern IDs like "pattern:META:other:1d" are already readable if (id.startsWith('pattern:')) { @@ -134,18 +136,19 @@ function EvidenceRef({ id, direction }: { id: string; direction: 'supporting' | ); } - // UUIDs — show as short clickable links to the document - if (UUID_RE.test(id)) { + // UUIDs — show document title if available, otherwise short ID + if (isUuid) { + const label = doc?.title ?? `doc:${id.slice(0, 8)}…`; return (
{sign}{' '} e.stopPropagation()} > - doc:{id.slice(0, 8)}… + {label}
);