refactor: performance, maintainability, and filter cleanup #58

Merged
clanker merged 3 commits from refactor/perf-and-cleanup into main 2026-09-07 17:54:32 +00:00
Member

Summary of changes

  • Filter pills and active group cleanup: Removed all vestigial filter pills, active group state tracking, and unused prop drilling across PageFilterBar, useCardFilter, ClassView, SphereView, FeatView, GearPageView, MartialTraditionsView, CastingTraditionsView, UsingPageView, and CoreArchetype views.
  • Duplicate card scoring elimination: Stopped passing full card collections as filter groups to useCardFilter in ClassView and SphereView. Both views now feed additionalItems for tag indexing without redundant group scoring passes.
  • Homepage client bundle reduction: Converted app/page.tsx into a Server Component by extracting the command palette launcher button into a client component (SearchPromptButton). The 11 JSON catalog indexes are rendered on the server instead of bundled in client JavaScript.
  • NotebookContext optimizations: Switched isPinned lookups to an O(1) Set lookup, memoized the provider context value, and removed dead custom group functions.
  • Client navigation in CommandPalette: Replaced window.location reloads with Next.js router.push to maintain client state.
  • Unified link preview resolution: Updated fetchContent in useLinkPreview to use resolveContentFromPage.
  • Badge logic deduplication: Extracted progression and modifier badge resolution into shared helpers in tagStyles.ts.
  • ArchetypeCard search expansion: Auto-expands matching features when active tag filters are present.
  • SidebarTOC scroll throttling: Added requestAnimationFrame throttling to scrollspy handler.

Verification

  • Audit script (python3 scripts/audit.py): 0 errors.
  • Production build (vercel build --prod): clean build, 481 static pages generated.
  • Production deployment: deployed to https://spheres4dummies.vercel.app with --archive=tgz.
## Summary of changes - **Filter pills and active group cleanup**: Removed all vestigial filter pills, active group state tracking, and unused prop drilling across PageFilterBar, useCardFilter, ClassView, SphereView, FeatView, GearPageView, MartialTraditionsView, CastingTraditionsView, UsingPageView, and CoreArchetype views. - **Duplicate card scoring elimination**: Stopped passing full card collections as filter groups to useCardFilter in ClassView and SphereView. Both views now feed additionalItems for tag indexing without redundant group scoring passes. - **Homepage client bundle reduction**: Converted app/page.tsx into a Server Component by extracting the command palette launcher button into a client component (SearchPromptButton). The 11 JSON catalog indexes are rendered on the server instead of bundled in client JavaScript. - **NotebookContext optimizations**: Switched isPinned lookups to an O(1) Set lookup, memoized the provider context value, and removed dead custom group functions. - **Client navigation in CommandPalette**: Replaced window.location reloads with Next.js router.push to maintain client state. - **Unified link preview resolution**: Updated fetchContent in useLinkPreview to use resolveContentFromPage. - **Badge logic deduplication**: Extracted progression and modifier badge resolution into shared helpers in tagStyles.ts. - **ArchetypeCard search expansion**: Auto-expands matching features when active tag filters are present. - **SidebarTOC scroll throttling**: Added requestAnimationFrame throttling to scrollspy handler. ## Verification - Audit script (python3 scripts/audit.py): 0 errors. - Production build (vercel build --prod): clean build, 481 static pages generated. - Production deployment: deployed to https://spheres4dummies.vercel.app with --archive=tgz.
- Remove unused filter pills and vestigial activeGroup logic across all views and hooks
- Eliminate duplicate card scoring passes in ClassView and SphereView
- Convert homepage to a Server Component with SearchPromptButton client launcher
- Optimize NotebookContext with O(1) Set lookup for isPinned, memoized value, and dead code cleanup
- Switch CommandPalette navigation to Next.js useRouter
- Unify link preview content resolution in useLinkPreview
- Deduplicate progression and modifier badge resolution in tagStyles
- Auto-expand ArchetypeCard features on active tag match
- Throttle SidebarTOC scroll listener with requestAnimationFrame
- Add hierarchical subitem generation in ClassView and SphereView for features, talent groups, option groups, feats, drawbacks, rules, and archetypes
- Default all expandable ToC sections to collapsed state
- Add hash anchor ancestor expansion on mount in SidebarTOC
- Align talent group section anchors for deep linking and scrollspy
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/Spheres4Dummies!58
No description provided.