Skip to content

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.

fix(macos): restore pending approval card when answering a question (#851)

Ohualtexc2388b2bc7d1
diff --git a/NotchBuddy/Sources/App/HookServer.swift b/NotchBuddy/Sources/App/HookServer.swift
index e785c34b..d02d7b83 100644
--- a/NotchBuddy/Sources/App/HookServer.swift
+++ b/NotchBuddy/Sources/App/HookServer.swift
@@ -344,7 +344,8 @@ final class HookServer: @unchecked Sendable {
closeQuestionCard(pill: entry.displayPill)
}
- /// No question left: close the card and give the focus back.
+ /// No question left: close the card and give the focus back, or return to
+ /// an approval waiting behind it (#851).
@MainActor
private func closeQuestionCard(pill: String?) {
let state = AppState.shared
@@ -357,6 +358,17 @@ final class HookServer: @unchecked Sendable {
withAnimation(.spring(response: 0.5, dampingFraction: 0.72)) { state.focusId = prev }
}
}
+ if let head = approvals.head {
+ state.pendingApproval = ApprovalInfo(sessionId: head.sessionId, tool: head.tool,
+ command: head.command, inputKey: head.inputKey,
+ pillId: head.displayPill, id: head.id,
+ queueCount: approvals.count,
+ projectName: head.projectName)
+ state.isPinned = true
+ withAnimation(.spring(response: 0.5, dampingFraction: 0.72)) { state.focusId = head.displayPill }
+ expandIfNeeded(to: .approval)
+ return
+ }
state.view = state.tasks.isEmpty ? .empty : .overview
}