native macOS codings agent orchestrator prowl.onev.cat
Something went wrong. Try again.
1.5 kB · 56 lines
Swift
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import SwiftUI
struct DeleteWorktreeConfirmationView: View { let confirmation: DeleteWorktreeConfirmation let onDeleteBranchChanged: (Bool) -> Void let onCancel: () -> Void let onDelete: () -> Void
var body: some View { VStack(alignment: .leading, spacing: 16) { VStack(alignment: .leading, spacing: 6) { Text(confirmation.title) .font(.headline) Text(confirmation.message) .foregroundStyle(.secondary) .fixedSize(horizontal: false, vertical: true) }
Toggle( "Also delete local branch", isOn: Binding( get: { confirmation.deleteBranch }, set: { onDeleteBranchChanged($0) } ) ) .help("Try to delete the local branch with git branch -d after removing the worktree.")
Text( """ Protected branches are kept. If safe branch deletion fails, Prowl asks before forcing it. \ Your choice is remembered for the next delete. """ ) .font(.footnote) .foregroundStyle(.secondary) .fixedSize(horizontal: false, vertical: true)
HStack { Spacer() Button("Cancel", role: .cancel) { onCancel() } .keyboardShortcut(.cancelAction) .help("Cancel")
Button("Delete", role: .destructive) { onDelete() } .keyboardShortcut(.defaultAction) .help("Delete worktree") } } .padding(24) .frame(width: 420) }}