diff --git a/TablePro/Views/Backup/BackupResultSheet.swift b/TablePro/Views/Backup/BackupResultSheet.swift index 6747cccec..466560c9a 100644 --- a/TablePro/Views/Backup/BackupResultSheet.swift +++ b/TablePro/Views/Backup/BackupResultSheet.swift @@ -48,7 +48,7 @@ struct BackupResultSheet: View { onClose() } .buttonStyle(.borderedProminent) - .keyboardShortcut(.return) + .keyboardShortcut(.defaultAction) } } .padding(24) diff --git a/TablePro/Views/Connection/ConnectionGroupPicker.swift b/TablePro/Views/Connection/ConnectionGroupPicker.swift index 2a36a217f..e2c47fe8c 100644 --- a/TablePro/Views/Connection/ConnectionGroupPicker.swift +++ b/TablePro/Views/Connection/ConnectionGroupPicker.swift @@ -153,13 +153,14 @@ struct CreateGroupSheet: View { Button("Cancel") { dismiss() } + .keyboardShortcut(.cancelAction) Button("Create") { onSave(groupName, groupColor, selectedParentId) dismiss() } - .keyboardShortcut(.return) .buttonStyle(.borderedProminent) + .keyboardShortcut(.defaultAction) .disabled(groupName.trimmingCharacters(in: .whitespaces).isEmpty) } } diff --git a/TablePro/Views/Connection/ConnectionTagEditor.swift b/TablePro/Views/Connection/ConnectionTagEditor.swift index 60e92dc15..86f0d307c 100644 --- a/TablePro/Views/Connection/ConnectionTagEditor.swift +++ b/TablePro/Views/Connection/ConnectionTagEditor.swift @@ -157,13 +157,14 @@ private struct CreateTagSheet: View { HStack { Button("Cancel") { dismiss() } + .keyboardShortcut(.cancelAction) Spacer() Button("Create") { onSave(tagName, tagColor) dismiss() } - .keyboardShortcut(.return) .buttonStyle(.borderedProminent) + .keyboardShortcut(.defaultAction) .disabled(tagName.trimmingCharacters(in: .whitespaces).isEmpty) } .padding(12) diff --git a/TablePro/Views/Settings/AIProviderDetailSheet.swift b/TablePro/Views/Settings/AIProviderDetailSheet.swift index 8f4bf16c1..237045148 100644 --- a/TablePro/Views/Settings/AIProviderDetailSheet.swift +++ b/TablePro/Views/Settings/AIProviderDetailSheet.swift @@ -27,6 +27,8 @@ struct AIProviderDetailSheet: View { @State private var copilotService = CopilotService.shared @State private var copilotErrorMessage: String? + @State private var showRemoveConfirmation = false + enum TestResult: Equatable { case success case failure(String) @@ -89,6 +91,18 @@ struct AIProviderDetailSheet: View { } } .frame(minWidth: 520, minHeight: 480) + .confirmationDialog( + String(format: String(localized: "Remove “%@”?"), draft.displayName), + isPresented: $showRemoveConfirmation, + titleVisibility: .visible + ) { + Button(String(localized: "Remove Provider"), role: .destructive) { + onDelete?() + } + Button(String(localized: "Cancel"), role: .cancel) {} + } message: { + Text(String(localized: "The provider configuration and stored API key will be deleted.")) + } } private var navigationTitle: String { @@ -461,7 +475,7 @@ struct AIProviderDetailSheet: View { private func deleteSection(onDelete: @escaping () -> Void) -> some View { Section { Button(role: .destructive) { - onDelete() + showRemoveConfirmation = true } label: { Label(String(localized: "Remove Provider"), systemImage: "trash") .frame(maxWidth: .infinity) diff --git a/TablePro/Views/Settings/LicenseActivationSheet.swift b/TablePro/Views/Settings/LicenseActivationSheet.swift index 0fa8d5555..aeb05ba0d 100644 --- a/TablePro/Views/Settings/LicenseActivationSheet.swift +++ b/TablePro/Views/Settings/LicenseActivationSheet.swift @@ -73,7 +73,6 @@ struct LicenseActivationSheet: View { dismiss() } .keyboardShortcut(.cancelAction) - .keyboardShortcut(.cancelAction) } } .padding(.top, 20) diff --git a/TablePro/Views/Settings/Sections/PairingApprovalSheet.swift b/TablePro/Views/Settings/Sections/PairingApprovalSheet.swift index 27534bbc6..b44923b34 100644 --- a/TablePro/Views/Settings/Sections/PairingApprovalSheet.swift +++ b/TablePro/Views/Settings/Sections/PairingApprovalSheet.swift @@ -220,6 +220,8 @@ struct PairingApprovalSheet: View { ) onComplete(.success(approval)) } + .buttonStyle(.borderedProminent) + .keyboardShortcut(.defaultAction) .disabled(approveDisabled) } }