condition

This commit is contained in:
Daniel Edrisian
2025-08-31 14:15:45 -07:00
parent f564f0518a
commit 89b8877f6a

View File

@@ -384,24 +384,26 @@ impl BottomPane {
/// Called when the agent requests user approval.
pub fn push_approval_request(&mut self, request: ApprovalRequest) {
// Send a system notification whenever an approval dialog is about to be shown.
match &request {
ApprovalRequest::Exec { command, .. } => {
let preview = command.join(" ");
let msg = format!("Approve \"{preview}\"?");
notifications::send_os_notification(&msg);
}
ApprovalRequest::ApplyPatch {
reason, grant_root, ..
} => {
let msg = if let Some(root) = grant_root {
format!("Approve patch changes? Grant write to {}", root.display())
} else if let Some(r) = reason {
format!("Approve patch changes? {r}")
} else {
"Approve patch changes?".to_string()
};
notifications::send_os_notification(&msg);
if !self.has_input_focus {
// Send a system notification whenever an approval dialog is about to be shown.
match &request {
ApprovalRequest::Exec { command, .. } => {
let preview = command.join(" ");
let msg = format!("Approve \"{preview}\"?");
notifications::send_os_notification(&msg);
}
ApprovalRequest::ApplyPatch {
reason, grant_root, ..
} => {
let msg = if let Some(root) = grant_root {
format!("Approve patch changes? Grant write to {}", root.display())
} else if let Some(r) = reason {
format!("Approve patch changes? {r}")
} else {
"Approve patch changes?".to_string()
};
notifications::send_os_notification(&msg);
}
}
}