Repository navigation
Clean up the codebase: remove dead code and duplication - #2
Merged
Merged
Conversation
- Remove unused types, decoded-but-unused fields, redundant initializers and CodingKeys (decode with convertFromSnakeCase instead) - Share request, status-check and pagination code in GitHubAPIClient - Deduplicate the install-check/polling startup in AppState - Move API response types to GitHubModels.swift and run filtering into pure functions on the model - Centralize the GitHub App client ID and installation URL - Extract shared button styling and QuitButton; split SettingsView into sections - Adopt current SwiftUI idioms: openURL/Link, foregroundStyle, .task instead of a per-render Timer.publish, buttons for clickable rows, accessibility labels for icon-only buttons and pickers Also fixes repos from a second installation being skipped, a misleading "Network error" for Keychain failures, and a spinner that could stay on after an invalid token signed the user out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores main's apply-once behavior without the NSHashTable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code review cleanup ahead of the repository going public. Intended to be behavior-preserving apart from the bug fixes listed below.
Changes
Dead code removed
ReposResponse, a leftover_ = statusin completion detection, afetchRepos()wrapper that only calledfetchAllRepos()Repository.htmlUrl,expiresIn,tokenType,scope,GitHubUser.id,AppInstallation.account,WorkflowRunsResponse.totalCount)CodingKeyslists (the decoders now use.convertFromSnakeCase)stopPolling(), an unnecessary panel-tracking set inAppDelegate, and a duplicate.environmentObjectDuplication removed
start()andloginWithGitHub(); nowstartMonitoring(token:)GitHubAPIClient: onegethelper for status checks and decoding, one generic paginator, one task-group bodyOAuthService: oneposthelperGitHubApp; the 200-repo cap and default settings are named constants.textButtonStyle()(about 15 copies) andQuitButton(4 copies); a single source for status colors and the run title;saveSettings()replaces 4 separate save callsOrganization
Models/GitHubModels.swift[WorkflowRun]OAuthServiceis astruct(it was a stateless actor)SettingsViewsplit into named sectionsSwiftUI
@Environment(\.openURL)andLinkinstead ofNSWorkspacein views.taskloop instead of aTimer.publishthat was recreated on every renderButtons instead ofonTapGesture.labelsHidden()foregroundStyle,.onChange(initial:),@ViewBuilderinstead ofGroup,privateenvironment objectsBehavior changes (bug fixes)
fetchAllReposcompared the running total across all installations with a single installation'stotal_count, so it could skip repos from a second installation.KeychainError.isLoadingcould staytrueafter an invalid token forced a sign-out.Testing
🤖 Generated with Claude Code