Skip to content

Refactor: Extract duplicated utilities into shared modules#25

Merged
fmadore merged 2 commits intomainfrom
claude/review-refactoring-opportunities-AwXVl
Feb 2, 2026
Merged

Refactor: Extract duplicated utilities into shared modules#25
fmadore merged 2 commits intomainfrom
claude/review-refactoring-opportunities-AwXVl

Conversation

@fmadore
Copy link
Owner

@fmadore fmadore commented Feb 2, 2026

  • Create chartColorUtils.ts: Extract CSS variable resolution and chart
    color utilities from 6 visualization components (~200 lines reduced)
  • Create typeUtils.ts: Centralize type badge/label functions from
    detail pages, eliminating duplicate switch statements
  • Add smartTruncate() to textUtils.ts: Remove 3 identical copies from
    seoUtils.ts (~60 lines reduced)
  • Add areFiltersActive() to filterUtils.ts: Share filter state check
    across publications and conference-activity pages
  • Update seoUtils.ts to use centralized type labels from typeUtils.ts
  • Fix activities page to use imported truncateTitle instead of local copy

Net reduction: ~330 lines of duplicated code

https://claude.ai/code/session_018ncgD2RWvSKx6fRUK62b7G

- Create chartColorUtils.ts: Extract CSS variable resolution and chart
  color utilities from 6 visualization components (~200 lines reduced)
- Create typeUtils.ts: Centralize type badge/label functions from
  detail pages, eliminating duplicate switch statements
- Add smartTruncate() to textUtils.ts: Remove 3 identical copies from
  seoUtils.ts (~60 lines reduced)
- Add areFiltersActive() to filterUtils.ts: Share filter state check
  across publications and conference-activity pages
- Update seoUtils.ts to use centralized type labels from typeUtils.ts
- Fix activities page to use imported truncateTitle instead of local copy

Net reduction: ~330 lines of duplicated code

https://claude.ai/code/session_018ncgD2RWvSKx6fRUK62b7G
- Remove scrollAnimations.ts: Deprecated module not imported anywhere,
  CSS-only animations are now used (.scroll-reveal, .scroll-reveal-scale)
- Remove scrollPreservation.ts: Dead code not imported by any component

Total: ~635 lines of unused code removed

https://claude.ai/code/session_018ncgD2RWvSKx6fRUK62b7G
@fmadore fmadore merged commit f00ccc9 into main Feb 2, 2026
2 checks passed
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.

2 participants