diff --git a/frontend/src/api/public-client.ts b/frontend/src/api/public-client.ts index 5616870..1fa5d68 100644 --- a/frontend/src/api/public-client.ts +++ b/frontend/src/api/public-client.ts @@ -68,6 +68,18 @@ export interface TechniquePageDetail { key_moments: KeyMomentSummary[]; creator_info: CreatorInfo | null; related_links: RelatedLinkItem[]; + version_count: number; +} + +export interface TechniquePageVersionSummary { + version_number: number; + created_at: string; + pipeline_metadata: Record | null; +} + +export interface TechniquePageVersionListResponse { + items: TechniquePageVersionSummary[]; + total: number; } export interface TechniqueListItem { @@ -217,6 +229,14 @@ export async function fetchTechnique( return request(`${BASE}/techniques/${slug}`); } +export async function fetchTechniqueVersions( + slug: string, +): Promise { + return request( + `${BASE}/techniques/${slug}/versions`, + ); +} + // ── Topics ─────────────────────────────────────────────────────────────────── export async function fetchTopics(): Promise { diff --git a/frontend/src/pages/TechniquePage.tsx b/frontend/src/pages/TechniquePage.tsx index 36a259d..2487291 100644 --- a/frontend/src/pages/TechniquePage.tsx +++ b/frontend/src/pages/TechniquePage.tsx @@ -151,7 +151,17 @@ export default function TechniquePage() { "en-US", { year: "numeric", month: "short", day: "numeric" }, ); - return `Compiled from ${sourceCount} source${sourceCount !== 1 ? "s" : ""} · ${momentCount} key moment${momentCount !== 1 ? "s" : ""} · Last updated ${updated}`; + const parts = [ + `Compiled from ${sourceCount} source${sourceCount !== 1 ? "s" : ""}`, + `${momentCount} key moment${momentCount !== 1 ? "s" : ""}`, + ]; + if (technique.version_count > 0) { + parts.push( + `${technique.version_count} version${technique.version_count !== 1 ? "s" : ""}`, + ); + } + parts.push(`Last updated ${updated}`); + return parts.join(" · "); })()}