refactor: extract hexToRgba and prefersReducedMotion to shared utils
Move hexToRgba() (3 identical copies) and prefersReducedMotion (5 module-level copies) to src/lib/utils.ts. Re-export prefersReducedMotion from constellation/constants.ts to preserve existing importers. Add clarifying comments to constellation.ts and tags.ts re-export layers (Phase 1.4).
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// Module-level cache: buildConstellationData() is expensive (D3 graph construction).
|
||||
// 5 consumers import from here instead of calling the builder independently.
|
||||
import type { ConstellationLink, ConstellationNode, RoleSkillMapping } from '@/types/pmr'
|
||||
import { buildConstellationData } from '@/data/timeline'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// Derives sidebar tags from timeline skills with color assignment.
|
||||
// Separated from Sidebar.tsx to keep data derivation out of UI components.
|
||||
import type { Tag } from '@/types/pmr'
|
||||
import { getTopTimelineSkills } from '@/data/timeline'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user