Make ⌘S open discard confirmation when there is nothing to merge

This commit is contained in:
Ian Gulliver
2026-10-22 13:28:43 -07:00
parent 75d904fb2b
commit 9fca82abaa
+2 -2
View File
@@ -36,7 +36,7 @@ func runGo(_ key: String, _ store: Store, _ overlays: Overlays) {
break break
} }
Task { Task {
if let task = store.findTask(taskId), task.state == .discardSuggested { if let task = store.findTask(taskId), task.status == .active, task.state == .discardSuggested || (task.mergeFacts.unmergedCommits == 0 && task.mergeFacts.unmergedFiles == 0) {
await confirmDiscard(task, store, overlays) await confirmDiscard(task, store, overlays)
return return
} }
@@ -80,7 +80,7 @@ private let shortcuts: [(String, [(String, String)])] = [
("⌘T", "Show every project's active tasks"), ("⌘T", "Show every project's active tasks"),
("⌘P", "Show the current project's dashboard"), ("⌘P", "Show the current project's dashboard"),
("⌘L", "Open the Lead tab and its composer, closing any view opened over a pane"), ("⌘L", "Open the Lead tab and its composer, closing any view opened over a pane"),
("⌘S", "Merge the right pane's task, or discard it when the agent suggests discarding"), ("⌘S", "Merge the right pane's task, or discard it when the agent suggests discarding or there is nothing to merge"),
("⌘[ ⌘]", "Bring the previous or next server's window forward"), ("⌘[ ⌘]", "Bring the previous or next server's window forward"),
("⌘/", "Show these shortcuts"), ("⌘/", "Show these shortcuts"),
("Esc", "Close the switcher, a dialog, or a view opened over a pane"), ("Esc", "Close the switcher, a dialog, or a view opened over a pane"),