Repository navigation
Filter installed dependencies from installed list - #244
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The UI-test helper has a critical compile issue, and the preferences test contains an unsafe force-unwrap.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (3)
What changed in this PR
Adds a persistent “Hide dependencies” switch to the Installed tab, filtering packages by installedOnRequest.
Changes:
- Adds filtering, selection handling, and persistence.
- Wires
UserDefaultspreferences through the app environment. - Adds localization, accessibility IDs, fixtures, and tests.
| File | Summary |
|---|---|
Tests/BrewRepositoriesTests/UserDefaultsInstalledPreferencesTests.swift |
Tests preference persistence. Moderate (3 votes): avoid force-unwrapping UserDefaults(suiteName:). |
Tests/BrewFeatureInstalledTests/SelfUpgradeCaskExclusionTests.swift |
Updates view-model construction. |
Tests/BrewFeatureInstalledTests/InstalledViewModelTestsSupport.swift |
Adds preference injection support. |
Tests/BrewFeatureInstalledTests/InstalledViewModelTests.swift |
Updates view-model initialization. |
Tests/BrewFeatureInstalledTests/InstalledViewModelHideDependenciesTests.swift |
Tests filtering and selection behavior. |
Tests/BrewFeatureInstalledTests/InstalledFeatureTestSupport.swift |
Adds test preference support. |
Tests/BrewAccessibilityIDTests/AXIDTests.swift |
Verifies accessibility identifiers. |
Sources/BrewRepositoryInterfaces/Protocols/InstalledPreferences.swift |
Defines the preferences protocol. |
Sources/BrewRepositoryInterfaces/Fakes/InstalledPreferencesStubs.swift |
Adds test and preview stubs. |
Sources/BrewRepositories/UserDefaultsInstalledPreferences.swift |
Implements UserDefaults persistence. |
Sources/BrewFeatureInstalled/Views/InstalledUpgradesColumns.swift |
Injects preferences into the feature. |
Sources/BrewFeatureInstalled/Views/InstalledPackagesView.swift |
Adds the Hide dependencies switch. Nit (2 votes): add deterministic UI coverage using a dependency fixture. |
Sources/BrewFeatureInstalled/ViewModels/InstalledViewModel.swift |
Applies filtering and selection fallback. |
Sources/BrewFeatureInstalled/Resources/Localizable.xcstrings |
Adds localized switch text. |
Sources/BrewCoreTestSupport/BrewPackageFixtures.swift |
Supports dependency-status fixtures. |
Sources/BrewAppEnvironment/RepositoryEnvironment.swift |
Adds the preferences environment entry. |
Sources/BrewAccessibilityID/AXID.swift |
Adds the switch accessibility identifier. |
Homebrew/BrewApp.swift |
Wires production preferences and test prefixes. |
BrewUITests/Screens/InstalledScreen.swift |
Adds UI-test switch helpers. Critical (1 vote): BrewUIElement does not define tap, so this helper will not compile. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
(cherry picked from commit 17bd164)
Replace the checkbox with a mini switch and rename the accessibility case to match; the wire string is unchanged. Also collapse AXIDTests' static-identifier check into a pairs table to bring it back under SwiftLint's function body limit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add an InstalledPreferences protocol (BrewRepositoryInterfaces), a UserDefaults adapter (BrewRepositories) and an in-memory stub, wired through the environment like the self-upgrade preferences. The view model's hideDependencies is now computed over the injected preferences, so the existing filter and selection tests are unchanged. BrewApp.init() was at SwiftLint's body-length limit, so the installed repository construction is collapsed onto one line to make room. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
graeme
force-pushed
the
filter-installed-dependencies
branch
from
September 22, 2026 14:15
350f1eb to
a169e57
Compare
graeme
enabled auto-merge
September 22, 2026 14:16
MikeMcQuaid
approved these changes
Sep 22, 2026
3 tasks done
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.
What and why
The Installed tab lists every installed package, including everything Homebrew pulled in as a dependency, so the ones you asked for are buried. This adds a "Hide dependencies" switch above the list that narrows it to packages installed on request.
Closes #232, which asks for a "Leaves" view. This filters on
installedOnRequest, matchingbrew leaves --installed-on-requestrather than plainbrew leaves.Continues #160 by @stybo, whose commit is preserved here with authorship intact. Two commits build on it:
SelfUpgradePreferencespattern: anInstalledPreferencesprotocol inBrewRepositoryInterfaces, aUserDefaultsInstalledPreferencesadapter inBrewRepositories, a stub for tests and previews, and injection fromBrewAppthrough an environment entry. The view model exposes it as a computed property over that observable dependency, so SwiftUI tracking survives without the view model owning storage. The defaults key carries the usual UI-testing prefix, so a test run cannot write into the real preferences.Validation
macOS 26.5 on Apple silicon, Xcode 26.5, Swift 6.3.2.
scripts/test: passed, 1118 tests in 135 suites, plus 30 in 4 for BrewUILint.mint run swiftformat --lint .andmint run swiftlint lint --strict: clean.Homebrew,HomebrewUpgradeHelperandSources: clean.scripts/localize verifyandscripts/localize sync --check: catalogs in sync.xcodebuild -scheme Brew: builds.scripts/test-ui, VoiceOver and keyboard checks.New tests cover seeding from preferences, write-through, filtering, composition with scope and search, selection fallback and restore, and the
UserDefaultsadapter.Screenshots
AI assistance
Claude Opus 5 via Claude Code wrote the switch and persistence commits and this description. I chose the approach, reviewed every line and ran the checks above.
🤖 Generated with Claude Code