fix parser commands to persist configuration#536
Merged
nschimme merged 1 commit intoJun 4, 2026
Merged
Conversation
This ensures that changes made by the CLI are persisted immediately since they could be undone if the user canceled the Preferences dialog.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures configuration changes triggered via CLI parser commands, hotkey updates, and certain UI actions are immediately persisted by writing the config after each mutation, preventing loss of changes if the preferences dialog is canceled. Sequence diagram for immediate config persistence on mutationssequenceDiagram
actor User
participant AbstractParser
participant HotkeyManager
participant MainWindow
participant Config
alt CLI_config_change
User ->> AbstractParser: doConfig
AbstractParser ->> Config: getConfig
AbstractParser ->> Config: write
end
alt Set_command_prefix
User ->> AbstractParser: setCommandPrefix
AbstractParser ->> Config: getConfig
AbstractParser ->> Config: write
end
alt Hotkey_update
User ->> HotkeyManager: setHotkey
HotkeyManager ->> Config: getConfig
HotkeyManager ->> Config: write
end
alt Hotkey_remove
User ->> HotkeyManager: removeHotkey
HotkeyManager ->> Config: getConfig
HotkeyManager ->> Config: write
end
alt Reset_or_clear_hotkeys
User ->> HotkeyManager: resetToDefaults
HotkeyManager ->> Config: getConfig
HotkeyManager ->> Config: write
User ->> HotkeyManager: clear
HotkeyManager ->> Config: getConfig
HotkeyManager ->> Config: write
end
alt Change_group_color
User ->> AbstractParser: parseGroup
AbstractParser ->> Config: getConfig
AbstractParser ->> Config: write
end
alt Change_map_mode
User ->> MainWindow: createActions
MainWindow ->> MainWindow: setConfigMapMode
MainWindow ->> Config: getConfig
MainWindow ->> Config: write
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Repeated calls to
getConfig().write()scattered across different code paths could be consolidated into a helper (e.g.,persistConfig()or similar) to reduce duplication and make future changes to persistence behavior easier to manage. - For hotkey and parser operations that may be triggered in rapid succession, consider whether immediate synchronous
write()on every change could cause performance issues and if a debounced or buffered persistence mechanism would be more appropriate.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Repeated calls to `getConfig().write()` scattered across different code paths could be consolidated into a helper (e.g., `persistConfig()` or similar) to reduce duplication and make future changes to persistence behavior easier to manage.
- For hotkey and parser operations that may be triggered in rapid succession, consider whether immediate synchronous `write()` on every change could cause performance issues and if a debounced or buffered persistence mechanism would be more appropriate.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #536 +/- ##
==========================================
+ Coverage 25.38% 25.69% +0.30%
==========================================
Files 521 521
Lines 43183 43192 +9
Branches 4709 4709
==========================================
+ Hits 10963 11099 +136
+ Misses 32220 32093 -127 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This ensures that changes made by the CLI are persisted immediately since they could be undone if the user canceled the Preferences dialog.
Summary by Sourcery
Ensure configuration changes made via hotkeys, parser commands, and UI actions are written to disk immediately.
Bug Fixes: