Skip to content

slim the animation context, delete dead modules, split the timeline stylesheet - #44

Merged
dapperdivers merged 2 commits into
masterfrom
refactor/slim-context-and-cleanup
Nov 20, 2026
Merged

dapperdivers merged 2 commits into
masterfrom
refactor/slim-context-and-cleanup

Conversation

@dapperdivers

Copy link
Copy Markdown
Owner

What

Three cleanups.

Animation context: 644 lines to 89

After the props-only refactor, the app read only five of the context's 22 fields, and only from organisms and layout components. The context now provides two:

  • animationEnabled: off when the visitor prefers reduced motion, and still controlled by the debug:toggle-animations event and window.__DEBUG_FLAGS.disableAnimations, exactly as before.
  • prefersReducedMotion

The shared variants and the stagger delay now come from @utils/motion, which the building blocks already use. Removed: entry-animation registry, animation controls, variant factories, low-power detection, optimizeVariants, the dev performance monitor hooks, MotionVariants, and the useAnimationOptimization hook.

The provider now wraps the app in Framer Motion's <MotionConfig reducedMotion="user">, so every motion element honours the OS reduced-motion setting, including ones that never ask the context. This is the one intended behaviour change: visitors with reduced motion on no longer get transform animations from any component.

Dead modules deleted

Sixteen modules that nothing imports, found by walking imports from the app entry, Storybook, tests and config: accessibility.tsx, accessibilityUtils.ts, animations.ts, imageOptimizerComponents.tsx, performanceMonitor.ts, validation.ts, three debug components, useEducation.ts, useExperience.ts, and stale mocks under __mocks__ folders.

Timeline.css split

The 691-line stylesheet shared by three components is now Timeline.css, TimelineCard.css and TimelineEasterEggOverlay.css, each imported by its own component. Rules were moved verbatim; every selector appears exactly once across the three files. A card rendered on its own (as in its stories) now carries all of its own styles.

Verification

  • typecheck (strict), lint with 0 errors, 123 unit tests
  • computed styles of all 705 elements on the built page match the live site at 1440 and 390 px
  • reduced motion: no text left invisible
  • timeline hidden extras: 27 of 27
  • Storybook: 509 stories, 0 render errors; 506 style-identical to the previous build, the other 3 are animated colour cycles that also differ between two runs of the same build

@dapperdivers
dapperdivers merged commit d1af77f into master Nov 20, 2026
4 checks passed
@dapperdivers
dapperdivers deleted the refactor/slim-context-and-cleanup branch November 20, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant