A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.
Swift ai-agentsanthropicantigravityclaudeclaude-codecodexcursordynamic-islandgemini-cliiosiphonlinuxmacosmacos-appmenubar-appnotchopen-sourceswiftswiftuiwindows
Alerts from every pill: another pill's finish or error opens the notch
Claudee434883fb9bb
diff --git a/NotchBuddy/Resources/Localizable.xcstrings b/NotchBuddy/Resources/Localizable.xcstringsindex cc8c87e6..9fbbf0ae 100644--- a/NotchBuddy/Resources/Localizable.xcstrings+++ b/NotchBuddy/Resources/Localizable.xcstrings@@ -1,6 +1,136 @@{"sourceLanguage" : "en","strings" : {+ "alerts.all-pills" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "الفتح عند تنبيهات كل الحبوب"+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "সব পিলের সতর্কতায় খুলুক"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Open for every pill’s alerts"+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abrir con los avisos de todas las píldoras"+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "S’ouvrir pour les alertes de toutes les pills"+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "हर पिल के अलर्ट पर खुलें"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Buka untuk peringatan semua pil"+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Abrir com os alertas de todas as pílulas"+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Открываться при оповещениях всех пилюль"+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "所有胶囊有提醒时都打开"+ }+ }+ }+ },+ "alerts.all-pills.help" : {+ "extractionState" : "manual",+ "localizations" : {+ "ar" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "عندما تنتهي حبة غير المعروضة أو تواجه خطأ، يعرضها النوتش لحظة ثم تعود حبتك."+ }+ },+ "bn" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "দেখানো পিল ছাড়া অন্য কোনো পিল শেষ হলে বা ত্রুটি হলে, নচ সেটি কিছুক্ষণ দেখায়, তারপর আপনার পিল ফিরে আসে।"+ }+ },+ "en" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "When a pill other than the one shown finishes or hits an error, the notch shows it for a moment, then the pill you had comes back."+ }+ },+ "es" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Cuando otra píldora distinta de la mostrada termina o da un error, el notch la muestra un momento y luego vuelve la tuya."+ }+ },+ "fr" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Quand une autre pill que celle affichée termine ou rencontre une erreur, le notch l’affiche un instant, puis ta pill revient."+ }+ },+ "hi" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "जब दिखाई जा रही पिल के अलावा कोई और पिल पूरी हो या उसमें गड़बड़ी हो, तो नॉच उसे थोड़ी देर दिखाता है, फिर आपकी पिल वापस आ जाती है।"+ }+ },+ "id" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Saat pil selain yang ditampilkan selesai atau mengalami galat, notch menampilkannya sebentar, lalu pilmu kembali."+ }+ },+ "pt-BR" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Quando outra pílula que não a exibida termina ou dá erro, o notch a mostra por um instante e depois a sua volta."+ }+ },+ "ru" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "Когда другая пилюля, не та что показана, завершает работу или получает ошибку, вырез ненадолго показывает её, затем возвращается ваша."+ }+ },+ "zh-Hans" : {+ "stringUnit" : {+ "state" : "translated",+ "value" : "当非当前显示的胶囊完成或出错时,刘海会短暂显示它,然后回到你原来的胶囊。"+ }+ }+ }+ },"whatsapp.advanced" : {"extractionState" : "manual","localizations" : {diff --git a/NotchBuddy/Sources/App/AppState.swift b/NotchBuddy/Sources/App/AppState.swiftindex e95c65b1..28803fed 100644--- a/NotchBuddy/Sources/App/AppState.swift+++ b/NotchBuddy/Sources/App/AppState.swift@@ -301,6 +301,10 @@ final class AppState: ObservableObject {@Published var openOnHover: Bool = false {didSet { UserDefaults.standard.set(openOnHover, forKey: "openOnHover") }}+ /// A pill other than the one shown finishes or fails: show its card for a moment (#683).+ @Published var alertsFromAllPills: Bool = false {+ didSet { UserDefaults.standard.set(alertsFromAllPills, forKey: "alertsFromAllPills") }+ }@Published var autoCloseInterval: TimeInterval = 15 {didSet { UserDefaults.standard.set(autoCloseInterval, forKey: "autoCloseInterval") }}@@ -538,6 +542,7 @@ final class AppState: ObservableObject {if let v = ud.string(forKey: "lmstudioServerURL"), !v.isEmpty { lmstudioServerURL = v }// Migrate old 60s default → 15sif let v = ud.object(forKey: "openOnHover") as? Bool { openOnHover = v }+ if let v = ud.object(forKey: "alertsFromAllPills") as? Bool { alertsFromAllPills = v }if let v = ud.object(forKey: "autoCloseInterval") as? Double {autoCloseInterval = (v == 60) ? 15 : v}diff --git a/NotchBuddy/Sources/App/HookServer.swift b/NotchBuddy/Sources/App/HookServer.swiftindex a423bd03..d7ef3437 100644--- a/NotchBuddy/Sources/App/HookServer.swift+++ b/NotchBuddy/Sources/App/HookServer.swift@@ -56,6 +56,8 @@ final class HookServer: @unchecked Sendable {private var focusBeforeQuestion: String? = nil // saved focus to restore after questionprivate var activeSessionId: String? = nil // current Claude Code sessionprivate var focusBeforeApproval: String? = nil // saved focus to restore after approval+ private var focusBeforeAlert: String? = nil // saved focus while another pill's card shows+ private var alertPill: String? = nil // the pill that took the focus for its alertprivate var sessions = PillSessionRegistry() // live sessions behind each pillprivate init() {}@@ -616,7 +618,7 @@ final class HookServer: @unchecked Sendable {state.tasks[idx].finalLine = finalText}if !terminalInFront { SoundEngine.shared.play("finish") }- if focused && !terminalInFront {+ if !terminalInFront && showsAlert(for: agentId, focused: focused) {expandIfNeeded(to: .finished)} else {setPillBadge(id: agentId, badge: .finished)@@ -644,7 +646,7 @@ final class HookServer: @unchecked Sendable {state.tasks[idx].finalLine = Self.stopFailureDetail(payload)}if !terminalInFront { SoundEngine.shared.play("error") }- if focused && !terminalInFront {+ if !terminalInFront && showsAlert(for: agentId, focused: focused) {expandIfNeeded(to: .error)} else {setPillBadge(id: agentId, badge: .error)@@ -727,6 +729,36 @@ final class HookServer: @unchecked Sendable {// MARK: - Helpers+ /// Whether a finish or an error opens the island. The pill shown always does; another pill+ /// does too with "Show alerts from every pill" (#683): it takes the focus for its card, and+ /// the pill that was shown comes back when the island closes. Never over an approval, a+ /// question, or a card the user is busy in (chat, mail, settings…).+ @MainActor+ private func showsAlert(for pill: String, focused: Bool) -> Bool {+ if focused { return true }+ let state = AppState.shared+ guard state.alertsFromAllPills, state.pendingApproval == nil, state.pendingQuestion == nil else { return false }+ if state.mode == .expanded, ![IslandView.overview, .finished, .error, .empty].contains(state.view) { return false }+ if focusBeforeAlert == nil { focusBeforeAlert = state.focusId }+ alertPill = pill+ withAnimation(.spring(response: 0.5, dampingFraction: 0.72)) { state.focusId = pill }+ return true+ }++ /// The island closed: the pill that was shown before another pill's alert comes back.+ @MainActor+ func restoreAlertFocus() {+ guard let prev = focusBeforeAlert else { return }+ let borrowed = alertPill+ focusBeforeAlert = nil+ alertPill = nil+ let state = AppState.shared+ // Only if the alert's pill is still the one shown (the user may have picked another).+ guard state.pendingApproval == nil, state.focusId == borrowed, borrowed != prev,+ state.tasks.contains(where: { $0.id == prev }) else { return }+ withAnimation(.spring(response: 0.5, dampingFraction: 0.72)) { state.focusId = prev }+ }+@MainActorprivate func expandIfNeeded(to view: IslandView) {let state = AppState.shareddiff --git a/NotchBuddy/Sources/App/IslandWindowController.swift b/NotchBuddy/Sources/App/IslandWindowController.swiftindex a152f4d9..de86dd1c 100644--- a/NotchBuddy/Sources/App/IslandWindowController.swift+++ b/NotchBuddy/Sources/App/IslandWindowController.swift@@ -605,6 +605,7 @@ final class IslandWindowController: NSWindowController {if prev == .expanded {SoundEngine.shared.play("close")if fsm.isHeldOpen?() != true { state.isPinned = false }+ HookServer.shared.restoreAlertFocus()}}diff --git a/NotchBuddy/Sources/App/SettingsView.swift b/NotchBuddy/Sources/App/SettingsView.swiftindex a08fc6f2..9ecf42c8 100644--- a/NotchBuddy/Sources/App/SettingsView.swift+++ b/NotchBuddy/Sources/App/SettingsView.swift@@ -342,6 +342,8 @@ struct SettingsView: View {VStack(alignment: .leading, spacing: 10) {Toggle("Open on hover", isOn: $state.openOnHover).help("Hovering the island opens it; it folds again shortly after the pointer leaves. Click inside to keep it open.")+ Toggle(String(localized: "alerts.all-pills"), isOn: $state.alertsFromAllPills)+ .help(String(localized: "alerts.all-pills.help"))HStack(spacing: 8) {Text("Close after")TextField("60", value: $state.autoCloseInterval, format: .number)diff --git a/windows/src/i18n/strings.json b/windows/src/i18n/strings.jsonindex 7cf66088..a1cdf8ad 100644--- a/windows/src/i18n/strings.json+++ b/windows/src/i18n/strings.json@@ -4215,6 +4215,17 @@"ru": "Открыть чат","id": "Buka chat"},+ "Open for every pill’s alerts": {+ "zh-Hans": "所有胶囊有提醒时都打开",+ "hi": "हर पिल के अलर्ट पर खुलें",+ "es": "Abrir con los avisos de todas las píldoras",+ "ar": "الفتح عند تنبيهات كل الحبوب",+ "fr": "S’ouvrir pour les alertes de toutes les pills",+ "bn": "সব পিলের সতর্কতায় খুলুক",+ "pt-BR": "Abrir com os alertas de todas as pílulas",+ "ru": "Открываться при оповещениях всех пилюль",+ "id": "Buka untuk peringatan semua pil"+ },"Open in Mail": {"zh-Hans": "在“邮件”中打开","hi": "Mail में खोलें",@@ -6734,6 +6745,17 @@"ru": "Услышав слова слева, Coucou пишет слова справа.","id": "Saat Coucou mendengar kata di kiri, ia menulis kata di kanan."},+ "When a pill other than the one shown finishes or hits an error, the notch shows it for a moment, then the pill you had comes back.": {+ "zh-Hans": "当非当前显示的胶囊完成或出错时,刘海会短暂显示它,然后回到你原来的胶囊。",+ "hi": "जब दिखाई जा रही पिल के अलावा कोई और पिल पूरी हो या उसमें गड़बड़ी हो, तो नॉच उसे थोड़ी देर दिखाता है, फिर आपकी पिल वापस आ जाती है।",+ "es": "Cuando otra píldora distinta de la mostrada termina o da un error, el notch la muestra un momento y luego vuelve la tuya.",+ "ar": "عندما تنتهي حبة غير المعروضة أو تواجه خطأ، يعرضها النوتش لحظة ثم تعود حبتك.",+ "fr": "Quand une autre pill que celle affichée termine ou rencontre une erreur, le notch l’affiche un instant, puis ta pill revient.",+ "bn": "দেখানো পিল ছাড়া অন্য কোনো পিল শেষ হলে বা ত্রুটি হলে, নচ সেটি কিছুক্ষণ দেখায়, তারপর আপনার পিল ফিরে আসে।",+ "pt-BR": "Quando outra pílula que não a exibida termina ou dá erro, o notch a mostra por um instante e depois a sua volta.",+ "ru": "Когда другая пилюля, не та что показана, завершает работу или получает ошибку, вырез ненадолго показывает её, затем возвращается ваша.",+ "id": "Saat pil selain yang ditampilkan selesai atau mengalami galat, notch menampilkannya sebentar, lalu pilmu kembali."+ },"When enabled, Coucou listens for the wake word « OK Coucou ». Speech recognition runs entirely on-device — no audio or transcript leaves your Mac.": {"zh-Hans": "启用后,Coucou 会监听唤醒词« OK Coucou »。语音识别完全在设备上运行—任何音频或文字记录都不会离开您的 Mac。","hi": "सक्षम होने पर, Coucou वेक शब्द « OK Coucou » सुनता है। वाक् पहचान पूरी तरह डिवाइस पर चलती है — कोई ऑडियो या ट्रांसक्रिप्ट आपके Mac को नहीं छोड़ता।",