[#144] Send macOS notification when a transcription completes - #146
Merged
Merged
Conversation
Mirror the web app's completion notifications in the native macOS app. - Kit: JobStatus.settledNotification(meetingTitle:error:) builds the UI-agnostic notification copy (completed/failed), unit-tested in Kit. - App: UserNotificationNotifier posts via UNUserNotificationCenter, suppressing when the app is frontmost (mirrors the web page-visible guard) and no-op'ing when un-bundled so bare swift run stays safe. - Request authorization once at launch; post from MeetingDetailStore's poll loop on the terminal job edge.
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.
Closes #144
Summary
Brings the native macOS app to parity with the web app, which posts a browser notification when a transcription job settles. The macOS app now posts a local notification ("Transcription complete" / "Transcription failed") when a meeting's job reaches a terminal state while the app is not frontmost.
Approach
JobStatus.settledNotification(meetingTitle:error:)builds the UI-agnostic notification copy (completed → "Transcription complete"; failed → "Transcription failed", using the job error verbatim when present). Placed in Kit so the copy is unit-tested by the existing runner; the App target is not covered by that runner.UserNotificationNotifierposts viaUNUserNotificationCenter, suppressing delivery when the app is frontmost (mirrors the web'sdocument.visibilityState === 'visible'guard). EveryUNUserNotificationCenter.current()access is guarded on a real bundle id, so running the App target bare viaswift runno longer crashes; un-bundled it is a silent no-op.applicationDidFinishLaunching); the notification is posted fromMeetingDetailStore's poll loop on the same terminal job edge the web app uses.Scope mirrors the web app deliberately: notifications fire while the meeting's detail view is open and polling. A window-independent background poller was considered out of scope for this chore. Server-side-reconciled failures (missing job after a service restart) stay silent, matching the web app, which only notifies on an explicit
failedjob status.Verification
swift build— succeeds (only pre-existingAudioPlaybackControllerwarnings).swift run MeetingTranscriberKitTests— 279 passed, 0 failed (includes newJobStatus.settledNotificationsuite).swift run MeetingTranscriberIntegrationTests— 22 passed, 0 failed.