---
estimated_steps: 19
estimated_files: 2
skills_used: []
---

# T03: Add frontend version count display and API client types

Add TypeScript types for version responses to the API client, fetch version count from the technique detail response, and display it in the technique page meta stats line.

## Steps

1. Update `frontend/src/api/public-client.ts`:
   - Add `version_count: number` to `TechniquePageDetail` interface
   - Add `TechniquePageVersionSummary` interface: { version_number: number, created_at: string, pipeline_metadata: Record<string, unknown> | null }
   - Add `TechniquePageVersionListResponse` interface: { items: TechniquePageVersionSummary[], total: number }
   - Add `fetchTechniqueVersions(slug: string)` function that calls GET /techniques/{slug}/versions

2. Update `frontend/src/pages/TechniquePage.tsx`:
   - The technique detail response now includes `version_count`. Display it in the meta stats line after moment count: `· N version(s)` (only show if version_count > 0).

3. Run `npm run build` to verify zero TypeScript errors.

## Must-Haves

- [ ] TechniquePageDetail TypeScript interface includes version_count: number
- [ ] fetchTechniqueVersions API function exists
- [ ] Version count displayed in technique page meta stats (when > 0)
- [ ] `npm run build` exits 0 with zero TypeScript errors

## Verification

- `cd frontend && npm run build` exits 0
- `grep -q 'version_count' frontend/src/api/public-client.ts` confirms type added
- `grep -q 'version_count' frontend/src/pages/TechniquePage.tsx` confirms display wired

## Inputs

- ``frontend/src/api/public-client.ts` — existing TypeScript API client with TechniquePageDetail interface to extend`
- ``frontend/src/pages/TechniquePage.tsx` — existing technique page component with meta stats line to modify`
- ``backend/schemas.py` — TechniquePageVersionSummary and TechniquePageVersionListResponse schemas from T02 (for TypeScript type mirroring)`

## Expected Output

- ``frontend/src/api/public-client.ts` — version_count added to TechniquePageDetail; version types and fetchTechniqueVersions function added`
- ``frontend/src/pages/TechniquePage.tsx` — meta stats line shows version count when > 0`

## Verification

cd frontend && npm run build && grep -q 'version_count' src/api/public-client.ts && grep -q 'version_count' src/pages/TechniquePage.tsx
