From d17874c7d6eafe106abeef9e5e913c214e1cc19b Mon Sep 17 00:00:00 2001 From: Tiago Date: Wed, 4 Nov 2026 07:22:11 -0300 Subject: [PATCH 1/2] List all repositories in settings instead of the first 200 The 200-repo cap now only applies to the fallback polling used when no repositories are selected. Co-Authored-By: Claude Sonnet 5.5 --- Sources/ActionBar/Models/AppState.swift | 3 --- Sources/ActionBar/Services/GitHubAPIClient.swift | 14 +++++++------- Sources/ActionBar/Views/SettingsView.swift | 7 ------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Sources/ActionBar/Models/AppState.swift b/Sources/ActionBar/Models/AppState.swift index 98f7517..b589a09 100644 --- a/Sources/ActionBar/Models/AppState.swift +++ b/Sources/ActionBar/Models/AppState.swift @@ -15,7 +15,6 @@ final class AppState { var isLoggingIn = false var availableRepos: [Repository] = [] var isLoadingRepos = false - var repoListIsCapped = false var repoListError: String? private(set) var showingSettings = false /// The run query from when Settings was opened. Polls keep using it until Settings closes, @@ -133,7 +132,6 @@ final class AppState { hasLoadedOnce = false errorMessage = nil availableRepos = [] - repoListIsCapped = false repoListError = nil showingSettings = false runQueryAtSettingsOpen = nil @@ -364,7 +362,6 @@ final class AppState { let repos = try await apiClient.fetchAllRepos(token: token) guard !Task.isCancelled, sessionID == self.sessionID else { return } availableRepos = repos - repoListIsCapped = repos.count >= GitHubAPIClient.maxRepositories } catch { guard !Task.isCancelled, sessionID == self.sessionID else { return } // Keep whatever list we had before. diff --git a/Sources/ActionBar/Services/GitHubAPIClient.swift b/Sources/ActionBar/Services/GitHubAPIClient.swift index a4a3476..5419731 100644 --- a/Sources/ActionBar/Services/GitHubAPIClient.swift +++ b/Sources/ActionBar/Services/GitHubAPIClient.swift @@ -1,8 +1,8 @@ import Foundation actor GitHubAPIClient { - /// Upper bound on repositories listed for selection (and polled when nothing is selected). - static let maxRepositories = 200 + /// Upper bound on repositories polled when none are explicitly selected. + private static let maxFallbackRepositories = 200 private static let baseURL = "https://api.github.com" private static let pageSize = 100 @@ -50,7 +50,7 @@ actor GitHubAPIClient { if let repoNames { repoFullNames = repoNames } else { - repoFullNames = try await fetchAllRepos(token: token).map(\.fullName) + repoFullNames = try await fetchAllRepos(token: token, limit: Self.maxFallbackRepositories).map(\.fullName) } let (allRuns, errors) = await withTaskGroup(of: (String, Result<[WorkflowRun], Error>).self) { group in @@ -153,21 +153,21 @@ actor GitHubAPIClient { try await !fetchInstallations(token: token).isEmpty } - func fetchAllRepos(token: String) async throws -> [Repository] { + func fetchAllRepos(token: String, limit: Int = .max) async throws -> [Repository] { let installations = try await fetchInstallations(token: token) var allRepos: [Repository] = [] - for installation in installations where allRepos.count < Self.maxRepositories { + for installation in installations where allRepos.count < limit { allRepos += try await fetchAllPages( InstallationRepositoriesResponse.self, path: "/user/installations/\(installation.id)/repositories", token: token, - limit: Self.maxRepositories - allRepos.count + limit: limit - allRepos.count ) } let sorted = allRepos.sorted { $0.fullName.localizedCaseInsensitiveCompare($1.fullName) == .orderedAscending } - return Array(sorted.prefix(Self.maxRepositories)) + return Array(sorted.prefix(limit)) } private func fetchInstallations(token: String) async throws -> [AppInstallation] { diff --git a/Sources/ActionBar/Views/SettingsView.swift b/Sources/ActionBar/Views/SettingsView.swift index acfe405..c89c213 100644 --- a/Sources/ActionBar/Views/SettingsView.swift +++ b/Sources/ActionBar/Views/SettingsView.swift @@ -222,13 +222,6 @@ struct SettingsView: View { .disabled(settings.selectedRepoNames == repoSelectionAtOpen) } - if appState.repoListIsCapped { - Text("Only the first \(GitHubAPIClient.maxRepositories) repositories are shown.") - .font(.caption2) - .foregroundStyle(.secondary) - .frame(maxWidth: .infinity, alignment: .leading) - } - if let error = appState.repoListError { Text("Couldn't load repositories: \(error)") .font(.caption2) From 1f7c00b5c8c7400685549060517faea73ce73c9c Mon Sep 17 00:00:00 2001 From: Piotr Chmolowski Date: Thu, 5 Nov 2026 22:03:28 +0100 Subject: [PATCH 2/2] Show the repo count and rate-limit risk in the select-all warning With the full list available, "All" can select far more repos than before, so the warning now says how many and that it can hit GitHub's rate limit. Co-Authored-By: Claude Opus 5.5 --- Sources/ActionBar/Views/SettingsView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ActionBar/Views/SettingsView.swift b/Sources/ActionBar/Views/SettingsView.swift index c89c213..eb0bd19 100644 --- a/Sources/ActionBar/Views/SettingsView.swift +++ b/Sources/ActionBar/Views/SettingsView.swift @@ -243,7 +243,7 @@ struct SettingsView: View { .font(.system(size: 12)) .foregroundStyle(.orange) VStack(alignment: .leading, spacing: 6) { - Text("Each selected repo requires a separate API call on every refresh. Selecting many repos will slow things down.") + Text("This selects \(filteredRepos.count) repos. Each selected repo requires a separate API call on every refresh, so selecting many repos will slow things down and can hit GitHub's rate limit.") .font(.caption2) .fixedSize(horizontal: false, vertical: true) HStack(spacing: 12) {