feat(desktop): fix mac notifications, new desktop icons#5403
Merged
Conversation
… 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.
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.
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:
osascript) approach inMacOSNotificationSenderwith a direct bridge toUNUserNotificationCenterusing 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:
desktop/README.mdandDesktopNotificationManager.ktto clarify that native notifications now useUNUserNotificationCenteron macOS (instead ofosascript), libnotify on Linux, and Windows toast notifications, with fallback to Compose tray notifications if native delivery fails. [1] [2]Testing Improvements:
MacOSNotificationSenderTestto 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 aFakeBridgefor reliable unit testing.