Merge spinner + swipeable PR sections; bump to 3.1
Build iOS App / Build .ipa and publish source (push) Successful in 25s
Build iOS App / Build .ipa and publish source (push) Successful in 25s
- MergeSheet: show a spinner in the toolbar while the merge is confirming/ rejecting, lock Cancel and interactive dismissal during the request, and prevent double-taps. - PR detail: replace the ScrollView-switch with a page-style TabView so you can swipe left/right to change sections (iOS 26 style); bottom bar taps still select. Make DetailTab Hashable. Bump to 3.1.
This commit is contained in:
1 parent
2301b8a861
commit
ed36ed72de
3 files changed
+36
-16
No files matched your search
@@ -65,6 +65,7 @@ struct MergeSheet: View {
|
||||
@ObservedObject var vm: PRDetailViewModel
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@State private var method = "merge"
|
||||
@State private var isMerging = false
|
||||
/// Called when the merge succeeds, so the parent can show the success
|
||||
/// animation and pop back to the landing page.
|
||||
var onSuccess: () -> Void = {}
|
||||
@@ -118,20 +119,33 @@ struct MergeSheet: View {
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button("Cancel") { dismiss() }
|
||||
if isMerging {
|
||||
// No cancel while a merge is in flight.
|
||||
} else {
|
||||
Button("Cancel") { dismiss() }
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .confirmationAction) {
|
||||
Button("Merge") { performMerge() }
|
||||
.disabled(SettingsStore.shared.mergeGateMode == .block
|
||||
&& vm.ciStatus == .failure)
|
||||
if isMerging {
|
||||
// Spinner while the merge is confirming/rejecting.
|
||||
ProgressView()
|
||||
} else {
|
||||
Button("Merge") { performMerge() }
|
||||
.disabled(SettingsStore.shared.mergeGateMode == .block
|
||||
&& vm.ciStatus == .failure)
|
||||
}
|
||||
}
|
||||
}
|
||||
.interactiveDismissDisabled(isMerging)
|
||||
}
|
||||
}
|
||||
|
||||
private func performMerge() {
|
||||
guard !isMerging else { return }
|
||||
isMerging = true
|
||||
Task {
|
||||
let success = await vm.merge(method: method)
|
||||
isMerging = false
|
||||
if success {
|
||||
dismiss()
|
||||
onSuccess()
|
||||
|
||||
Reference in new issue
Block a user