diff --git a/GiteaPR.xcodeproj/project.pbxproj b/GiteaPR.xcodeproj/project.pbxproj index cfe6e4d..65116c1 100644 --- a/GiteaPR.xcodeproj/project.pbxproj +++ b/GiteaPR.xcodeproj/project.pbxproj @@ -187,7 +187,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "GiteaPR"; @@ -197,7 +197,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.7; + MARKETING_VERSION = 1.8; PRODUCT_BUNDLE_IDENTIFIER = com.bueso.giteapr; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -211,7 +211,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 8; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = ""; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = "GiteaPR"; @@ -221,7 +221,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.7; + MARKETING_VERSION = 1.8; PRODUCT_BUNDLE_IDENTIFIER = com.bueso.giteapr; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/GiteaPR/Detail/Tabs.swift b/GiteaPR/Detail/Tabs.swift index 4b7c350..1574d80 100644 --- a/GiteaPR/Detail/Tabs.swift +++ b/GiteaPR/Detail/Tabs.swift @@ -218,14 +218,16 @@ struct ChecksTab: View { .font(.caption) .buttonStyle(.bordered) } - NavigationLink { - JobLogsView(repo: vm.repo, runID: run.id, jobID: job.id, - jobName: job.name) - } label: { - Text("Logs") - .font(.caption) + if hasRun(job) { + NavigationLink { + JobLogsView(repo: vm.repo, runID: run.id, jobID: job.id, + jobName: job.name) + } label: { + Text("Logs") + .font(.caption) + } + .buttonStyle(.bordered) } - .buttonStyle(.bordered) } } } @@ -263,4 +265,14 @@ struct ChecksTab: View { let c = (job.conclusion ?? "").lowercased() return c == "failure" || c == "cancelled" } + + /// A job has run only once it has a terminal conclusion. Queued/running + /// jobs (grey, no logs yet) hide the Logs button. + private func hasRun(_ job: ActionJob) -> Bool { + let s = job.status.lowercased() + if s == "queued" || s == "running" || s == "waiting" || s == "requested" { + return false + } + return (job.conclusion ?? "").lowercased() != "" + } } diff --git a/GiteaPR/Views/InboxView.swift b/GiteaPR/Views/InboxView.swift index 9aa1c0b..d4d3ea3 100644 --- a/GiteaPR/Views/InboxView.swift +++ b/GiteaPR/Views/InboxView.swift @@ -19,9 +19,7 @@ struct InboxView: View { ContentUnavailableView( "No open PRs", systemImage: "tray", - description: Text(vm.filter == .all - ? "Nothing to review." - : "No PRs match this filter.")) + description: Text("Nothing to review.")) } else { List { ForEach(vm.displayedRows) { row in @@ -38,17 +36,6 @@ struct InboxView: View { .toolbar { ToolbarItem(placement: .primaryAction) { settingsButton } } - .toolbar { - ToolbarItemGroup(placement: .bottomBar) { - Picker("Filter", selection: $vm.filter) { - ForEach(InboxFilter.allCases) { f in - Text(f.rawValue).tag(f) - } - } - .pickerStyle(.segmented) - .disabled(vm.displayedRows.isEmpty && vm.isLoading) - } - } .navigationDestination(for: PRRow.self) { row in PRDetailView(repo: row.repo, prNumber: row.pr.number) }