Repository navigation
feat(notification): bridge desktop native notifications with app icon and window focus - #674
Merged
Merged
Conversation
… and window focus
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
Addresses notification presentation and click-activation issues in DSH Desktop:
http://127.0.0.1:<port>were previously handled by Chromium without the application's bundle icon, causing macOS/Windows to show a generic or fallback icon. The bridge now routes notifications through Electron's nativeNotificationwithdesktopIconPath().mainWindow.show(),mainWindow.focus(), andapp.focus({ steal: true })on macOS.clickandcloseevents back to the renderer so web-sidenotification.onclickandnotification.onclosecontinue to function seamlessly.Implementation
src/main/desktop-notification.ts: Main process handler managing nativeNotificationinstances, click activation, and teardown.src/preload/desktop-notification.ts: Interceptswindow.Notificationin the main world and bridges creation, click, and close events via IPC.test/desktop-notification.test.ts: Unit tests verifying IPC registration, payload validation, notification lifecycle, and window activation on click.Verification
npm run typecheckpasses.npm run buildpasses.npx vitest run test/desktop-notification.test.tspasses (4/4 tests).