Skip to content

Add 'Hide dependencies' filter checkbox to Installed packages view - #160

Open
stybo wants to merge 1 commit into
Homebrew:mainfrom
stybo:filter-installed-dependencies
Open

Add 'Hide dependencies' filter checkbox to Installed packages view#160
stybo wants to merge 1 commit into
Homebrew:mainfrom
stybo:filter-installed-dependencies

Conversation

@stybo

@stybo stybo commented Sep 10, 2026

Copy link
Copy Markdown

PR: Add 'Hide dependencies' filter checkbox to Installed packages view

Summary

Adds an optional "Hide dependencies" checkbox toggle to the Installed packages view, allowing users to filter the list down to explicitly requested packages (installedOnRequest) and reduce clutter from secondary dependencies.

Changes

UI & Presentation

  • InstalledPackagesView: Added a hideDependenciesToggle checkbox beneath the scope picker, styled with .brewSubheadline and secondary text coloring.

View Model & Filtering

  • InstalledViewModel:
    • Added hideDependencies: Bool (defaults to false).
    • Updated InstalledPackagesContent.filtered(hidingDependencies:) and filteredContent(...) to filter by \.installedOnRequest.
    • Generalized selection re-homing (updateSelectionForFilterChange) to handle row preview fallbacks and restorations when toggling the dependency filter.

Accessibility & Test Support

  • BrewAccessibilityID: Added .installedHideDependenciesCheckbox ("installed.hideDependencies") to AXID and verified wire-format in AXIDTests.
  • InstalledScreen: Added hideDependenciesCheckbox and toggleHideDependencies() helpers for UI tests.
  • BrewPackageFixtures: Added installedOnRequest parameter to InstalledBrewPackage.fixture (defaults to true).
  • InstalledViewModelHideDependenciesTests: Added unit test coverage for default state, filtering direct vs. dependency packages, composition with scope picker and search queries, and row selection fallback/restoration.

Why this split (optional)

Leverages the existing installedOnRequest flag already exposed by InstalledBrewPackage to provide immediate filtering capability in the Installed tab without modifying the underlying data layer or database schema.

Testing

  • Ran unit and integration test suite: DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter BrewFeatureInstalledTests (226 tests passed across 26 suites).
  • Verified accessibility ID stability and string serialization in AXIDTests.
  • Verified selection state fallback and restoration when toggling hideDependencies.

PR checklist

  • Have you followed this repository's contribution and workflow guidance?
  • Have you explained what changed and why this should land now?
  • Have you run relevant local checks for the changed scope?
  • Are changes scoped and free of unrelated modifications?

  • AI was used to generate or assist with generating this PR.
  • If yes, describe exactly how AI was used and what manual verification was performed:
    • AI assisted with structuring unit tests and formatting the PR description. All changes were verified locally via automated test suites.

Follow-ups (optional)

  • Persist the user's checkbox preference across app restarts if desired.

Copilot AI balanced review requested due to automatic review settings September 10, 2026 18:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not accepting PRs until 7.0.0 launched.

@MikeMcQuaid
MikeMcQuaid dismissed their stale review September 13, 2026 14:09

7.0.0 launched.

@MikeMcQuaid
MikeMcQuaid requested a review from graeme September 13, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants