Fix #731: add configurable tray window shortcuts#732
Draft
Orinks wants to merge 1 commit into
Draft
Conversation
Users who minimize AccessiWeather to the tray need a keyboard path to restore or hide the window and hear the current tray information without using the mouse. This adds configurable shortcut preferences, validates them in Settings, and registers tray/window hotkeys when the platform supports them while preserving in-window accelerators. Constraint: Show-window behavior must still work after the frame is hidden to the tray, so the new shortcuts register as hotkeys when wx exposes RegisterHotKey Rejected: Add fixed in-window accelerators only | they cannot restore a hidden tray window Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep reserved shortcut validation aligned with existing menu and section accelerators before adding more configurable shortcuts Tested: ./.venv/bin/ruff check src/accessiweather/app_shortcuts.py src/accessiweather/shortcut_preferences.py src/accessiweather/models/config_settings.py src/accessiweather/models/config_constants.py src/accessiweather/models/config_serialization.py src/accessiweather/models/config_validation.py src/accessiweather/ui/system_tray.py src/accessiweather/ui/dialogs/settings_tabs/advanced.py src/accessiweather/ui/dialogs/settings_dialog_handlers.py tests/gui/test_main_window_minimize.py tests/test_settings_dialog_shortcuts.py tests/test_shortcut_preferences.py tests/test_system_tray.py Tested: ./.venv/bin/pytest -q tests/gui/test_main_window_minimize.py tests/test_settings_dialog_shortcuts.py tests/test_shortcut_preferences.py tests/test_system_tray.py Tested: ./.venv/bin/pytest -q tests/test_settings_dialog_tray_text.py tests/test_config_manager.py Not-tested: Real desktop global-hotkey registration on Windows/Linux/macOS outside the wx stub environment Related: #731
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
Adds configurable keyboard shortcuts for showing the main window, hiding it to the tray, and reading the current tray information.
Why
Issue #731 asked for keyboard access to common tray/window actions and clarified that default shortcuts should be editable to match user preferences.
Root Cause
AccessiWeather only had hard-coded in-window accelerators, so there was no keyboard path for tray-specific actions and no way to customize those shortcuts in Settings.
What Changed
Validation
./.venv/bin/ruff check src/accessiweather/app_shortcuts.py src/accessiweather/shortcut_preferences.py src/accessiweather/models/config_settings.py src/accessiweather/models/config_constants.py src/accessiweather/models/config_serialization.py src/accessiweather/models/config_validation.py src/accessiweather/ui/system_tray.py src/accessiweather/ui/dialogs/settings_tabs/advanced.py src/accessiweather/ui/dialogs/settings_dialog_handlers.py tests/gui/test_main_window_minimize.py tests/test_settings_dialog_shortcuts.py tests/test_shortcut_preferences.py tests/test_system_tray.py./.venv/bin/pytest -q tests/gui/test_main_window_minimize.py tests/test_settings_dialog_shortcuts.py tests/test_shortcut_preferences.py tests/test_system_tray.py./.venv/bin/pytest -q tests/test_settings_dialog_tray_text.py tests/test_config_manager.pyNotes
Global hotkey registration is covered by stubs in tests; I did not validate real desktop hotkey registration on a live Windows/Linux/macOS session.