Skip to content

feat(tray): add notification area support - #128

Merged
Orinks merged 5 commits into
devfrom
codex/system-tray-support
May 9, 2026
Merged

feat(tray): add notification area support#128
Orinks merged 5 commits into
devfrom
codex/system-tray-support

Conversation

@Orinks

@Orinks Orinks commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a cross-platform wx notification area icon with show, transfer queue, update check, and exit actions
  • Add settings to show the notification area icon and optionally minimize there on close
  • Cover tray lifecycle, settings persistence, and settings dialog accessibility wiring with tests

Tests

  • ..venv\Scripts\python.exe -m pytest
  • ..venv\Scripts\python.exe -m ruff check .
  • ..venv\Scripts\python.exe -m ruff format --check .
  • git diff --check

Orinks and others added 5 commits May 9, 2026 00:04
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>
@Orinks
Orinks merged commit 3bbf8f9 into dev May 9, 2026
6 checks passed
@Orinks
Orinks deleted the codex/system-tray-support branch May 9, 2026 04:24
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