refactor: code smell remediation across core modules#50
Merged
flexiondotorg merged 5 commits intomainfrom Mar 25, 2026
Merged
Conversation
- i18n: delegate getLocalizedString to getLocalizedEntry - config: introduce getConfigValue helpers and consolidate 9 getters - main: merge dual did-fail-load handlers with first-fire semantics Improves maintainability and reduces duplication across core modules. Signed-off-by: Martin Wimpress <code@wimpress.io>
…dString Delegate to getLocalizedEntry() to remove duplicated lang-matching logic, reducing maintenance burden and ensuring consistent behaviour across both functions. Signed-off-by: Martin Wimpress <code@wimpress.io>
- Replace redundant once() listener with guard flag on on() listener - Ensure markCssReady() executes exactly once despite repeated failures - Add clarifying comments on handler purpose and timing Signed-off-by: Martin Wimpress <code@wimpress.io>
Replace local state tracking in discord-presence and wedgeDetector with a shared Player snapshot method. Introduces PlaybackSnapshot interface and maintains isPlaying, positionUs, and state in Player class. This centralises playback data, removing duplicate state variables from multiple integrations. Signed-off-by: Martin Wimpress <code@wimpress.io>
- Extract buildStartPageSubmenu to handle start page radio group - Extract buildNotificationsSubmenu for notification toggle - Extract buildDiscordSubmenu for Discord RPC toggle - Extract buildStyleSubmenu for theme selection - Extract buildZoomSubmenu for zoom factor options - Introduce SubmenuContext interface for shared parameters - Reduce buildContextMenu from 216 to 64 lines Improves testability and readability by separating concerns. Signed-off-by: Martin Wimpress <code@wimpress.io>
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.
Summary
This PR consolidates three phases of targeted code smell remediation that eliminate duplication, improve maintainability, and reduce cyclomatic complexity across core modules. All changes are refactoring with no functional impact; the full test suite (218 tests) passes.
Changes
getLocalizedString, consolidate did-fail-load patterns, simplify config helpersPlayerclass; migrate Discord presence and wedge detector to use shared stateTesting
All 218 tests passing. No functional changes; refactoring only.