fix(skills-page): source pills and category sidebar collapsed to All only (#34194)

Regression from PR #33809 (lazy-fetch refactor). The `sources` and
`categoryEntries` useMemo blocks were derived from `allSkillsLocal`
but had empty/incomplete deps arrays — so they computed once at mount
when the catalog was still `[]`, then never recomputed when the fetch
resolved.

Symptom: live site shows only the "All 87,639" source button and
"All Skills 87,639" category — no per-source pills (ClawHub, skills.sh,
LobeHub, etc.) and no category breakdown. Filtering by source/category
is unusable.

Fix: add `allSkillsLocal` to both deps arrays so they recompute when
data arrives. Local build green on en + zh-Hans.
This commit is contained in:
Teknium 2026-05-28 17:11:40 -07:00 committed by GitHub
parent e7c99651fb
commit 78a54d2c00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -500,7 +500,7 @@ export default function SkillsDashboard() {
const sources = useMemo(() => {
const set = new Set(allSkillsLocal.map((s) => s.source));
return SOURCE_ORDER.filter((s) => s === "all" || set.has(s));
}, []);
}, [allSkillsLocal]);
const categoryEntries = useMemo(() => {
const pool =
@ -523,7 +523,7 @@ export default function SkillsDashboard() {
return Array.from(map.entries())
.sort((a, b) => b[1].count - a[1].count)
.map(([key, { label, count }]) => ({ key, label, count }));
}, [sourceFilter]);
}, [sourceFilter, allSkillsLocal]);
const filtered = useMemo(() => {
const q = debouncedSearch.toLowerCase().trim();