feat: Replaced meaningless '0 views' display with topic-category counts…

- "frontend/src/pages/CreatorDetail.tsx"

GSD-Task: S03/T02
This commit is contained in:
jlightner 2026-03-31 05:26:18 +00:00
parent 7a3db5212b
commit 59491c7803
3 changed files with 109 additions and 1 deletions

View file

@ -27,7 +27,7 @@ Note on the subquery approach: The `list_techniques` endpoint currently uses `se
- Estimate: 45m - Estimate: 45m
- Files: backend/schemas.py, backend/routers/techniques.py, frontend/src/api/public-client.ts, frontend/src/pages/Home.tsx, frontend/src/App.css - Files: backend/schemas.py, backend/routers/techniques.py, frontend/src/api/public-client.ts, frontend/src/pages/Home.tsx, frontend/src/App.css
- Verify: curl -s http://ub01:8096/api/v1/techniques?limit=3 | python3 -c "import sys,json; items=json.load(sys.stdin)['items']; assert all('key_moment_count' in i for i in items), 'missing key_moment_count'; print('API OK')" && cd frontend && npx tsc --noEmit && npm run build - Verify: curl -s http://ub01:8096/api/v1/techniques?limit=3 | python3 -c "import sys,json; items=json.load(sys.stdin)['items']; assert all('key_moment_count' in i for i in items), 'missing key_moment_count'; print('API OK')" && cd frontend && npx tsc --noEmit && npm run build
- [ ] **T02: Replace 'views' stat with topic-category breakdown on creator detail page** — Replace the meaningless '0 views' display on the creator detail page with a compact topic-category breakdown derived from the already-fetched techniques array. - [x] **T02: Replaced meaningless '0 views' display with topic-category counts derived from techniques array on creator detail page** — Replace the meaningless '0 views' display on the creator detail page with a compact topic-category breakdown derived from the already-fetched techniques array.
Steps: Steps:
1. In `frontend/src/pages/CreatorDetail.tsx`, find the stats span showing `{creator.view_count.toLocaleString()} views` (around line 110) 1. In `frontend/src/pages/CreatorDetail.tsx`, find the stats span showing `{creator.view_count.toLocaleString()} views` (around line 110)

View file

@ -0,0 +1,30 @@
{
"schemaVersion": 1,
"taskId": "T01",
"unitId": "M008/S03/T01",
"timestamp": 1774934617293,
"passed": false,
"discoverySource": "task-plan",
"checks": [
{
"command": "cd frontend",
"exitCode": 0,
"durationMs": 6,
"verdict": "pass"
},
{
"command": "npx tsc --noEmit",
"exitCode": 1,
"durationMs": 835,
"verdict": "fail"
},
{
"command": "npm run build",
"exitCode": 254,
"durationMs": 86,
"verdict": "fail"
}
],
"retryAttempt": 1,
"maxRetries": 2
}

View file

@ -0,0 +1,78 @@
---
id: T02
parent: S03
milestone: M008
provides: []
requires: []
affects: []
key_files: ["frontend/src/pages/CreatorDetail.tsx"]
key_decisions: ["Computed topic counts client-side from existing techniques array rather than adding a new API endpoint", "Sorted categories by count descending for readability"]
patterns_established: []
drill_down_paths: []
observability_surfaces: []
duration: ""
verification_result: "TypeScript compilation passes, production build succeeds, grep confirms topic_category usage and view_count removal. Browser verification on ub01:8096 shows topic categories rendering correctly on creator detail page."
completed_at: 2026-03-31T05:26:00.400Z
blocker_discovered: false
---
# T02: Replaced meaningless '0 views' display with topic-category counts derived from techniques array on creator detail page
> Replaced meaningless '0 views' display with topic-category counts derived from techniques array on creator detail page
## What Happened
---
id: T02
parent: S03
milestone: M008
key_files:
- frontend/src/pages/CreatorDetail.tsx
key_decisions:
- Computed topic counts client-side from existing techniques array rather than adding a new API endpoint
- Sorted categories by count descending for readability
duration: ""
verification_result: passed
completed_at: 2026-03-31T05:26:00.400Z
blocker_discovered: false
---
# T02: Replaced meaningless '0 views' display with topic-category counts derived from techniques array on creator detail page
**Replaced meaningless '0 views' display with topic-category counts derived from techniques array on creator detail page**
## What Happened
Removed the view_count reference from CreatorDetail.tsx and replaced it with a computed topic-category breakdown. The implementation reduces the techniques array into a Record of category counts, sorts by count descending, and renders inline with dot separators matching the existing UI pattern. When no techniques are loaded, the category section is hidden. No CSS changes needed.
## Verification
TypeScript compilation passes, production build succeeds, grep confirms topic_category usage and view_count removal. Browser verification on ub01:8096 shows topic categories rendering correctly on creator detail page.
## Verification Evidence
| # | Command | Exit Code | Verdict | Duration |
|---|---------|-----------|---------|----------|
| 1 | `cd frontend && npx tsc --noEmit` | 0 | ✅ pass | 2800ms |
| 2 | `cd frontend && npm run build` | 0 | ✅ pass | 2700ms |
| 3 | `grep -q 'topic' frontend/src/pages/CreatorDetail.tsx` | 0 | ✅ pass | 10ms |
| 4 | `! grep -q 'view_count' frontend/src/pages/CreatorDetail.tsx` | 0 | ✅ pass | 10ms |
## Deviations
None.
## Known Issues
Data has case-inconsistent topic categories ('Sound design' vs 'Sound Design') appearing as separate entries — upstream data quality issue.
## Files Created/Modified
- `frontend/src/pages/CreatorDetail.tsx`
## Deviations
None.
## Known Issues
Data has case-inconsistent topic categories ('Sound design' vs 'Sound Design') appearing as separate entries — upstream data quality issue.