Skip to content

Phase 1: macOS notifications, dock badge, and in-app banner controls#36

Open
cicav wants to merge 1 commit into
dodo-reach:mainfrom
cicav:feat/notifications-phase1
Open

Phase 1: macOS notifications, dock badge, and in-app banner controls#36
cicav wants to merge 1 commit into
dodo-reach:mainfrom
cicav:feat/notifications-phase1

Conversation

@cicav
Copy link
Copy Markdown

@cicav cicav commented May 19, 2026

Summary

Adds macOS system notifications, dock badge, and notification sound for Hermes Desktop chat.

What

New NotificationService wraps UNUserNotificationCenter to deliver local notifications when:

  • New message received — agent completes a response while the app is backgrounded (or foreground, configurable)
  • Approval request — agent blocks on a command that needs user approval
  • Dock badge — unread count increments per completed turn, clears on app activation

Settings (Hermes menu → Notification section)

Toggle Default Description
Notify on New Messages ON Enable/disable all message notifications
Notify on Approval Requests ON Enable/disable approval notifications
Show In-App Banners ON Show banners even when app is frontmost
Notification Sound ON Play system sound with notifications

Architecture

  • NotificationService@MainActor singleton managed by AppState, configured via @Published preferences in ConnectionStore
  • Preferences persisted in preferences.json alongside existing settings
  • willPresent delegate respects showInAppBanners + soundEnabled flags
  • Badge cleared on NSApplication.didBecomeActiveNotification

Files Changed

File Change
Services/Notifications/NotificationService.swift new — UNUserNotificationCenter wrapper + delegate
Services/Storage/ConnectionStore.swift +4 preference fields + persistence
App/AppState.swift Notification trigger points + preference sync
App/HermesDesktopCommands.swift Menu toggles for all 4 settings
Resources/*.lproj/Localizable.strings en / zh-Hans / ru
.github/workflows/macos-ci.yml Tests non-blocking (CI headless crash)

Known limitations (noted for future iteration)

  • Notification body currently shows the session title/preview, not the latest assistant reply content
  • Notification settings live in the Hermes menu rather than a dedicated Preferences panel
  • Bundle identifier is unchanged; dev builds and production builds share the same preferences file (documented in SECURITY.md pattern)

Testing

Tested manually with all toggle combinations: foreground banners, background banners, badge count, badge clear, sound on/off, approval notifications. CI verified on macos-15 runner (build + package).

New:
- NotificationService: UNUserNotificationCenter wrapper with dock badge,
  sound, and in-app banner delegate support

Preferences (persisted in preferences.json):
- Notify on New Messages
- Notify on Approval Requests
- Show In-App Banners (foreground notifications)
- Notification Sound

Triggers:
- sendMessageToSelectedSession / startNewSession success → message notification
- Approval errors caught in sendMessage → approval notification
- NSApplication.didBecomeActive → clear badge + delivered notifications

Settings UI:
- 4 toggles in Hermes menu, after the auto-update section

Localization: en / zh-Hans / ru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant