Loading...
Category Stats Configuration (src/lib/config/category-config.ts)
New CategoryStatsConfig interface for homepage stats display
getCategoryStatsConfig() function dynamically generates stats config from registry
Auto-derives icons, display text, and animation delays from UNIFIED_CATEGORY_REGISTRY
Comprehensive JSDoc documentation on configuration-driven architecture
Type System Improvements
Generic CategoryMetadata and EnrichedMetadata types replace manual unions
All types now derive from registry instead of hardcoded lists
Future-proof: Works with any category in UNIFIED_CATEGORY_REGISTRY
Homepage Data Loading (src/app/page.tsx)
Before: 7+ hardcoded category variables (rulesData, mcpData, agentsData, etc.) with manual destructuring
After: Dynamic Record<CategoryId, Metadata[]> generated from getAllCategoryIds()
Impact: Skills automatically included in data fetching, enrichment, and transformation pipelines
Reduced LOC: ~100 lines of hardcoded patterns eliminated
Added comprehensive inline documentation explaining Modern 2025 Architecture patterns
Homepage Stats Display (src/components/features/home/index.tsx)
Before: 7 hardcoded stat counters with manual icon mapping
After: Dynamic map() over getCategoryStatsConfig() from registry
Impact: Skills stat counter appears automatically with correct icon and animation timing
Zero manual updates required when adding categories
Maintains staggered animation timing (100ms delays auto-calculated)
Lazy Content Loaders (src/components/shared/lazy-content-loaders.tsx)
Before: Hardcoded loader object with 7 explicit category entries
After: Dynamic buildLazyContentLoaders() factory function generating loaders from registry
Impact: Skills loader automatically created and tree-shakeable
Future categories require zero changes to this file
Content Utilities (src/lib/utils/content.utils.ts)
Before: transformForHomePage() with hardcoded 8-property object type
After: Generic Record<string, ContentItem[]> with dynamic transformation
Impact: Handles any number of categories without type changes
Simplified from 25 lines of hardcoded transforms to 10 lines of dynamic logic
TypeScript Schema (src/lib/schemas/components/page-props.schema.ts)
Before: Hardcoded stats object with 7 category properties
After: z.record(z.string(), z.number()) for dynamic categories
Impact: Skills (and future categories) automatically type-safe
Eliminated TypeScript compiler errors when adding categories
TL;DR: Eliminated all hardcoded category references throughout the codebase. Homepage, stats display, data loading, and type systems now derive dynamically from UNIFIED_CATEGORY_REGISTRY. Adding new categories (like Skills) requires zero manual updates across the application - everything auto-updates from a single configuration source.
Refactored the entire homepage and content loading architecture from hardcoded category lists to configuration-driven dynamic generation. This architectural improvement means Skills (and any future categories) automatically appear in all homepage sections (Featured, Stats, All/Infinity Scroll) without manual intervention.
Homepage Data Loading (src/app/page.tsx)
rulesData, mcpData, agentsData, etc.) with manual destructuringRecord<CategoryId, Metadata[]> generated from getAllCategoryIds()Homepage Stats Display (src/components/features/home/index.tsx)
map() over getCategoryStatsConfig() from registryLazy Content Loaders (src/components/shared/lazy-content-loaders.tsx)
buildLazyContentLoaders() factory function generating loaders from registryContent Utilities (src/lib/utils/content.utils.ts)
transformForHomePage() with hardcoded 8-property object typeRecord<string, ContentItem[]> with dynamic transformationTypeScript Schema (src/lib/schemas/components/page-props.schema.ts)
stats object with 7 category propertiesz.record(z.string(), z.number()) for dynamic categoriesCategory Stats Configuration (src/lib/config/category-config.ts)
CategoryStatsConfig interface for homepage stats displaygetCategoryStatsConfig() function dynamically generates stats config from registryUNIFIED_CATEGORY_REGISTRYType System Improvements
CategoryMetadata and EnrichedMetadata types replace manual unionsUNIFIED_CATEGORY_REGISTRY