feat(tray): add notification area support - #128
Merged
Conversation
Add a cross-platform wx TaskBarIcon integration so users can restore the app, open the transfer queue, check for updates, or exit from the notification area while keeping all actions available from the main UI and settings dialog. Constraint: PortkeyDrop PRs target dev and desktop UI controls must remain keyboard and screen-reader accessible. Rejected: Tray-only minimize behavior by default | would make close semantics surprising and could strand users who do not use notification area affordances. Confidence: high Scope-risk: moderate Directive: Keep notification-area actions mirrored by normal menus or dialogs so the tray never becomes the only accessible path. Tested: .\\.venv\\Scripts\\python.exe -m pytest; .\\.venv\\Scripts\\python.exe -m ruff check .; .\\.venv\\Scripts\\python.exe -m ruff format --check .; git diff --check Not-tested: Manual tray interaction on macOS and Linux desktops. Co-authored-by: OmX <omx@oh-my-codex.dev>
Remove the Windows Exit menu Alt+F4 accelerator so Alt+F4 reaches the frame close event instead of the explicit exit command. Constraint: File > Exit must remain a real exit while window close gestures honor the minimize-to-notification-area setting. Rejected: Treating Alt+F4 as File > Exit | bypassed the saved close-to-tray preference. Confidence: high Scope-risk: narrow Directive: Keep close gestures separate from explicit exit commands when adding tray lifecycle behavior. Tested: .\\.venv\\Scripts\\python.exe -m pytest tests/test_app.py::test_windows_menu_does_not_override_alt_f4_close tests/test_app.py::test_macos_menu_uses_command_q_for_exit_not_disconnect tests/test_system_tray.py::test_close_minimizes_to_tray_when_enabled; .\\.venv\\Scripts\\python.exe -m ruff check src\\portkeydrop\\app.py tests\\test_app.py; .\\.venv\\Scripts\\python.exe -m ruff format --check src\\portkeydrop\\app.py tests\\test_app.py; git diff --check Not-tested: Manual Alt+F4 retest after pushing. Co-authored-by: OmX <omx@oh-my-codex.dev>
Use the macOS command-key label for the Exit menu while preserving the Windows fix that leaves Alt+F4 to the close event. Constraint: macOS menus should expose Command shortcuts, not Control shortcuts. Rejected: Keeping Ctrl+Q in the macOS menu | it is the wrong platform convention and screen-reader-visible text. Confidence: high Scope-risk: narrow Directive: Keep platform shortcut labels aligned with native desktop conventions. Tested: .\\.venv\\Scripts\\python.exe -m pytest tests/test_app.py::test_macos_menu_uses_command_q_for_exit_not_disconnect tests/test_app.py::test_windows_menu_does_not_override_alt_f4_close; .\\.venv\\Scripts\\python.exe -m ruff check src\\portkeydrop\\app.py tests\\test_app.py; .\\.venv\\Scripts\\python.exe -m ruff format --check src\\portkeydrop\\app.py tests\\test_app.py; git diff --check Not-tested: Manual macOS menu rendering. Co-authored-by: OmX <omx@oh-my-codex.dev>
Keep the macOS quit menu accelerator as Ctrl+Q in source because wx maps Ctrl accelerators to the Command key on macOS. Constraint: Command+Q must remain the native macOS quit gesture; wx accelerator syntax expresses that as Ctrl+Q, not a literal Cmd token. Rejected: Literal Cmd+Q accelerator text | may not be parsed consistently by wx and fights the documented Ctrl-to-Command mapping. Confidence: high Scope-risk: narrow Directive: Use RawCtrl only for the physical Control key on macOS; use Ctrl when the user-facing shortcut should be Command. Tested: .\\.venv\\Scripts\\python.exe -m pytest tests/test_app.py::test_macos_menu_uses_command_q_for_exit_not_disconnect tests/test_app.py::test_windows_menu_does_not_override_alt_f4_close; .\\.venv\\Scripts\\python.exe -m ruff check src\\portkeydrop\\app.py tests\\test_app.py; .\\.venv\\Scripts\\python.exe -m ruff format --check src\\portkeydrop\\app.py tests\\test_app.py; git diff --check Not-tested: Manual macOS Command+Q runtime test. Co-authored-by: OmX <omx@oh-my-codex.dev>
Increase changed-line coverage for the tray icon paths so the PR can satisfy the coverage gate before merging. Constraint: PR #128 coverage gate requires at least 80 percent diff coverage against origin/dev. Confidence: high Scope-risk: narrow Directive: Keep tray behavior covered through icon setup, menu actions, tooltip updates, and platform-specific restore behavior. Tested: full pytest suite with coverage XML, local diff-cover gate at 96 percent, and Ruff. Not-tested: Manual tray verification after this test-only change. Co-authored-by: OmX <omx@oh-my-codex.dev>
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
Tests