Skip to content

Fix #731: add configurable tray window shortcuts#732

Draft
Orinks wants to merge 1 commit into
devfrom
fix/AccessiWeather-issue-731
Draft

Fix #731: add configurable tray window shortcuts#732
Orinks wants to merge 1 commit into
devfrom
fix/AccessiWeather-issue-731

Conversation

@Orinks

@Orinks Orinks commented Jul 9, 2026

Copy link
Copy Markdown
Owner

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

  • added persisted shortcut preferences plus normalization and validation helpers
  • registered the tray/window shortcuts as app accelerators and global hotkeys when wx exposes hotkey support
  • wired show, hide, and tray-info reading through the existing tray and screen-reader status paths
  • exposed the new shortcut fields in Settings > Advanced and added a changelog entry
  • added focused shortcut, tray, settings, and config regression tests

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.py

Notes

Global hotkey registration is covered by stubs in tests; I did not validate real desktop hotkey registration on a live Windows/Linux/macOS session.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant