Removed code duplication and unset event listeners#9262
Merged
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #9262 +/- ##
===========================================
- Coverage 74.17% 74.17% -0.01%
===========================================
Files 428 429 +1
Lines 44964 44970 +6
Branches 3917 3918 +1
===========================================
+ Hits 33352 33356 +4
- Misses 11612 11614 +2
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR reduces code duplication and improves event listener management on the quality control and consensus management pages while also refining URL hash updates.
- Removes duplicate definitions of getTabFromHash by importing a shared utility function.
- Implements proper cleanup of hashchange event listeners using a named callback.
- Substitutes window.location.hash assignment with window.history.replaceState for better URL management in consensus management.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/utils/location-utils.ts | Introduces a shared utility for hash extraction to reduce duplication. |
| src/components/quality-control/quality-control-page.tsx | Replaces the internal getTabFromHash with the imported version and enhances event listener cleanup. |
| src/components/consensus-management-page/consensus-management-page.tsx | Applies similar improvements as quality control and refines URL hash updates using history.replaceState. |
bsekachev
added a commit
that referenced
this pull request
Mar 27, 2025
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.


Motivation and context
How has this been tested?
Checklist
developbranchLicense
Feel free to contact the maintainers if that's a concern.