mirror of
https://github.com/niels-emmer/myace.git
synced 2026-09-13 23:53:30 +02:00
[PR #103] [MERGED] fix: category counts showing (0) on community collection detail page #103
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
github-mirrors/myace#103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/niels-emmer/myace/pull/103
Author: @niels-emmer
Created: 8/15/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @niels-emmer
Base:
main← Head:fix/community-category-counts📝 Commits (1)
7544b84fix: category counts showing (0) on community collection detail page📊 Changes
2 files changed (+147 additions, -9 deletions)
View changed files
➕
frontend/src/pages/CommunityCollectionDetail.test.tsx(+129 -0)📝
frontend/src/pages/CommunityCollectionDetail.tsx(+18 -9)📄 Description
The bug
Collections → open a community collection → click any category (Skills/Agents/Rules/…) → every other category counter drops to (0). Only "All" restores them.
Root cause
CommunityCollectionDetail.tsxfetched artifacts pre-filtered by type from the server (queryKey: ['community-artifacts', id, typeFilter], passingtype:), then derived the per-category counts from that same filtered array — so every non-selected category counted zero artifacts.This is the identical bug #51 fixed on the owned-collection page. That fix only touched
CollectionDetail.tsx; the community page was never updated.#99 and #102 misdiagnosed this as a stale cached SPA shell because only
CollectionDetail.tsxwas inspected. Confirmed against the live VPS bundle, which still contained the buggy per-type refetch:The fix
Fetch the full list once, unfiltered; filter client-side via
useMemo— matchingCollectionDetail.tsx. Both pages now share the same approach, and the query comment explains why so it doesn't regress a third time.Test plan
CommunityCollectionDetail.test.tsx— verified it fails against the old query and passes against the fix (not just passing-by-default)npm run lintclean (2 pre-existing unrelated warnings)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.