From 8da2f907d690a59124d9008c0d8e1e792133702b Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 24 Mar 2026 16:39:15 -0500 Subject: fix: add nested comments to satisfy sonar rule swift:S1186 --- Hutch/Views/Builds/BuildDetailView.swift | 4 +++- Hutch/Views/Inbox/ThreadDetailView.swift | 5 ++++- Hutch/Views/Pastes/PasteDetailView.swift | 4 +++- Hutch/Views/Repositories/HgRepositorySettingsView.swift | 13 ++++++++++--- Hutch/Views/Repositories/RepositorySettingsView.swift | 8 ++++++-- Hutch/Views/Settings/SettingsView.swift | 8 ++++++-- Hutch/Views/Tickets/TicketDetailView.swift | 4 +++- 7 files changed, 35 insertions(+), 11 deletions(-) (limited to 'Hutch/Views') diff --git a/Hutch/Views/Builds/BuildDetailView.swift b/Hutch/Views/Builds/BuildDetailView.swift index 104b961..1c2e2bb 100644 --- a/Hutch/Views/Builds/BuildDetailView.swift +++ b/Hutch/Views/Builds/BuildDetailView.swift @@ -87,7 +87,9 @@ struct BuildDetailView: View { } } .alert("Cancel Build?", isPresented: $showCancelConfirmation) { - Button("Keep Running", role: .cancel) {} + Button("Keep Running", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Cancel Build", role: .destructive) { Task { await viewModel?.cancelJob() } } diff --git a/Hutch/Views/Inbox/ThreadDetailView.swift b/Hutch/Views/Inbox/ThreadDetailView.swift index e4c34e7..143200f 100644 --- a/Hutch/Views/Inbox/ThreadDetailView.swift +++ b/Hutch/Views/Inbox/ThreadDetailView.swift @@ -277,7 +277,10 @@ private struct MailComposeView: UIViewControllerRepresentable { return controller } - func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} + func updateUIViewController(_ uiViewController: UIViewController, context: Context) { + // The view controller is fully configured in makeUIViewController. + // No state-driven updates are required. + } final class Coordinator: NSObject, MFMailComposeViewControllerDelegate { let onComplete: (Result) -> Void diff --git a/Hutch/Views/Pastes/PasteDetailView.swift b/Hutch/Views/Pastes/PasteDetailView.swift index df3a8be..19cfd52 100644 --- a/Hutch/Views/Pastes/PasteDetailView.swift +++ b/Hutch/Views/Pastes/PasteDetailView.swift @@ -63,7 +63,9 @@ struct PasteDetailView: View { } } .alert("Delete Paste?", isPresented: $showDeleteConfirmation) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { if await viewModel?.deletePaste() == true { diff --git a/Hutch/Views/Repositories/HgRepositorySettingsView.swift b/Hutch/Views/Repositories/HgRepositorySettingsView.swift index 5f45da8..6a27465 100644 --- a/Hutch/Views/Repositories/HgRepositorySettingsView.swift +++ b/Hutch/Views/Repositories/HgRepositorySettingsView.swift @@ -55,7 +55,9 @@ struct HgRepositorySettingsView: View { "Permanently delete \(repository.owner.canonicalName)/\(repository.name)?", isPresented: $showDeleteConfirmation ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { await viewModel.deleteRepository() @@ -76,7 +78,9 @@ struct HgRepositorySettingsView: View { } } )) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Access", role: .destructive) { guard let entry = pendingACLDeletion else { return } Task { @@ -234,7 +238,10 @@ struct HgRepositorySettingsView: View { .font(.caption) .foregroundStyle(.secondary) - Button("Remove Revision", role: .destructive) {} + Button("Remove Revision", role: .destructive) { + // Not implemented: the hg.sr.ht API does not expose a histedit endpoint. + // This button is disabled until the API supports revision removal. + } .disabled(true) } } diff --git a/Hutch/Views/Repositories/RepositorySettingsView.swift b/Hutch/Views/Repositories/RepositorySettingsView.swift index 5606ec6..ff72335 100644 --- a/Hutch/Views/Repositories/RepositorySettingsView.swift +++ b/Hutch/Views/Repositories/RepositorySettingsView.swift @@ -58,7 +58,9 @@ struct RepositorySettingsView: View { "Permanently delete \(repository.owner.canonicalName)/\(repository.name)?", isPresented: $showDeleteConfirmation ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Delete", role: .destructive) { Task { await viewModel.deleteRepository() @@ -79,7 +81,9 @@ struct RepositorySettingsView: View { } } )) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Access", role: .destructive) { guard let entry = pendingACLDeletion else { return } Task { diff --git a/Hutch/Views/Settings/SettingsView.swift b/Hutch/Views/Settings/SettingsView.swift index 30758a8..e90f4e3 100644 --- a/Hutch/Views/Settings/SettingsView.swift +++ b/Hutch/Views/Settings/SettingsView.swift @@ -99,7 +99,9 @@ struct SettingsView: View { } ) ) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button(pendingDestructiveAction?.confirmationLabel ?? "Confirm", role: .destructive) { guard let action = pendingDestructiveAction else { return } pendingDestructiveAction = nil @@ -608,7 +610,9 @@ private struct EditProfileSheet: View { } } .alert("Remove Avatar?", isPresented: $isShowingRemoveAvatarConfirmation) { - Button("Cancel", role: .cancel) {} + Button("Cancel", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } Button("Remove Avatar", role: .destructive) { Task { await viewModel.removeAvatar() diff --git a/Hutch/Views/Tickets/TicketDetailView.swift b/Hutch/Views/Tickets/TicketDetailView.swift index 0631d7f..6ed5df0 100644 --- a/Hutch/Views/Tickets/TicketDetailView.swift +++ b/Hutch/Views/Tickets/TicketDetailView.swift @@ -424,7 +424,9 @@ private struct EventRow: View { .padding(.horizontal) .padding(.vertical, 8) .alert("System Status Change", isPresented: $isShowingSystemStatusInfo) { - Button("OK", role: .cancel) {} + Button("OK", role: .cancel) { + // Alert dismissal is implicit; no additional action required. + } } message: { Text("This status change was recorded automatically or without a named user attached to the event.") } -- cgit v1.2.3