Skip to content

feat(desktop): fix mac notifications, new desktop icons#5403

Merged
jamesarich merged 2 commits into
mainfrom
feat/desktop-icons
May 11, 2026
Merged

feat(desktop): fix mac notifications, new desktop icons#5403
jamesarich merged 2 commits into
mainfrom
feat/desktop-icons

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

This pull request significantly improves native notification support for macOS in the desktop application by replacing the previous AppleScript-based approach with a direct integration using the macOS UserNotifications framework via JNA and the Objective-C runtime. This change ensures notifications are properly attributed to the application, enhances reliability, and allows for more robust testing. Documentation and test code have also been updated to reflect the new implementation.

Native macOS Notification Delivery:

  • Replaces the old AppleScript (osascript) approach in MacOSNotificationSender with a direct bridge to UNUserNotificationCenter using JNA and the Objective-C runtime, ensuring notifications are attributed to the app bundle and not Script Editor. Authorization is now handled natively, and notification options (sound, subtitle, etc.) are set via the framework.

Documentation Updates:

  • Updates documentation in desktop/README.md and DesktopNotificationManager.kt to clarify that native notifications now use UNUserNotificationCenter on macOS (instead of osascript), libnotify on Linux, and Windows toast notifications, with fallback to Compose tray notifications if native delivery fails. [1] [2]

Testing Improvements:

  • Refactors MacOSNotificationSenderTest to test the new bridge-based implementation. Removes tests related to command/script construction and adds tests for bridge availability, single authorization request, correct sound handling, and category-to-subtitle mapping. Introduces a FakeBridge for reliable unit testing.

… via JNA

Replace the `osascript` implementation with a native bridge using JNA and the Objective-C runtime. This ensures notifications are correctly attributed to the app bundle rather than the system script editor and improves overall reliability.

- Implement `UNUserNotificationCenter` integration via a new `MacNotificationBridge`.
- Add support for requesting notification authorization on macOS.
- Update `DesktopNotificationManager` documentation to reflect native delivery paths for macOS, Linux, and Windows.
- Refactor `MacOSNotificationSenderTest` to use a mockable bridge for more robust testing.
@github-actions github-actions Bot added the enhancement New feature or request label May 11, 2026
@jamesarich jamesarich merged commit c77e03c into main May 11, 2026
14 checks passed
@jamesarich jamesarich deleted the feat/desktop-icons branch May 11, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant