feat: Replaced meaningless '0 views' display with topic-category counts…
- "frontend/src/pages/CreatorDetail.tsx" GSD-Task: S03/T02
This commit is contained in:
parent
7a3db5212b
commit
59491c7803
3 changed files with 109 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ Note on the subquery approach: The `list_techniques` endpoint currently uses `se
|
|||
- 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
|
||||
- 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:
|
||||
1. In `frontend/src/pages/CreatorDetail.tsx`, find the stats span showing `{creator.view_count.toLocaleString()} views` (around line 110)
|
||||
|
|
|
|||
30
.gsd/milestones/M008/slices/S03/tasks/T01-VERIFY.json
Normal file
30
.gsd/milestones/M008/slices/S03/tasks/T01-VERIFY.json
Normal 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
|
||||
}
|
||||
78
.gsd/milestones/M008/slices/S03/tasks/T02-SUMMARY.md
Normal file
78
.gsd/milestones/M008/slices/S03/tasks/T02-SUMMARY.md
Normal 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.
|
||||
Loading…
Add table
Reference in a new issue