Skip to content

[#144] Send macOS notification when a transcription completes - #146

Merged
julien731 merged 1 commit into
mainfrom
chore/144-macos-completion-notifications
Sep 4, 2026
Merged

julien731 merged 1 commit into
mainfrom
chore/144-macos-completion-notifications

Conversation

@julien731

Copy link
Copy Markdown
Member

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

  • Kit (testable): 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.
  • App (thin shim): UserNotificationNotifier posts via UNUserNotificationCenter, suppressing delivery when the app is frontmost (mirrors the web's document.visibilityState === 'visible' guard). Every UNUserNotificationCenter.current() access is guarded on a real bundle id, so running the App target bare via swift run no longer crashes; un-bundled it is a silent no-op.
  • Wire-up: authorization requested once at launch (applicationDidFinishLaunching); the notification is posted from MeetingDetailStore'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 failed job status.

Verification

  • swift build — succeeds (only pre-existing AudioPlaybackController warnings).
  • swift run MeetingTranscriberKitTests — 279 passed, 0 failed (includes new JobStatus.settledNotification suite).
  • swift run MeetingTranscriberIntegrationTests — 22 passed, 0 failed.

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.
@julien731 julien731 added the chore Maintenance or housekeeping task label Sep 4, 2026
@julien731 julien731 self-assigned this Sep 4, 2026
@julien731 julien731 added feature New feature or enhancement and removed chore Maintenance or housekeeping task labels Sep 4, 2026
@julien731
julien731 merged commit acf14f8 into main Sep 4, 2026
5 checks passed
@julien731
julien731 deleted the chore/144-macos-completion-notifications branch September 4, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send macOS notification when a transcription completes

1 participant