Refactor: Extract duplicated utilities into shared modules#25
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
color utilities from 6 visualization components (~200 lines reduced)
detail pages, eliminating duplicate switch statements
seoUtils.ts (~60 lines reduced)
across publications and conference-activity pages
Net reduction: ~330 lines of duplicated code
https://claude.ai/code/session_018ncgD2RWvSKx6fRUK62b7G