Scope the 鈱楻 doctor re-check to the Doctor screen - #156
Merged
Merged
Conversation
鈱楻 refetched every cached surface plus the doctor report, so browsing Installed or Discover and hitting refresh kicked off a full `brew doctor` diagnostic run in the background. Unlike the other surfaces that is not a cache refetch, and nothing on screen was waiting for it. Installed, upgrades, catalogue and config still refresh from any screen; the doctor report now only re-runs when Doctor is the selected sidebar item. The decision lives on SidebarItem as an explicit switch, mirroring axDestination, so a future sidebar case cannot silently opt in. Adds the first tests to the BrewTests target (file-system-synchronized group, so no project file change): Doctor re-runs, every other item does not, and exactly one item does. They compile and run under the Brew-Unit scheme on CI; the sandbox cannot launch the app-hosted bundle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXUw1iTa4GM7qAmFX247Zn
MikeMcQuaid
approved these changes
Sep 9, 2026
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.
PR: Only re-run brew doctor when the Doctor screen asks
Summary
Cmd+R refetched every cached surface and also kicked off a full
brew doctorrun, whichever screen was showing. The doctor re-check now runs only when
Doctor is the selected sidebar item.
Changes
MainWindowView.refreshAll()routes the doctor leg throughrefreshDoctorReportIfSelected(), which returns early unless Doctor isselected. It is still started concurrently with the three cache reloads, so
refreshing from Doctor is no slower than before.
SidebarItem.refreshesDoctorReportcarries the decision as an explicitswitch, mirroring
axDestination, so a future sidebar case cannot silentlyopt in.
Doctor's own "Run Again" button is untouched.
Testing
BrewTests/SidebarItemRefreshTests.swift: Doctor re-runs, every othersidebar item does not, and exactly one item does. These are the first
tests in the BrewTests target; it is a file-system-synchronized group, so
no project file change was needed.
xcodebuild build-for-testing -scheme Brew-Unit: TEST BUILD SUCCEEDED.launch in my sandbox (LaunchServices -10810). CI runs the Brew-Unit
scheme, so they execute there.
scripts/test: all package tests passed (BrewKit and BrewUILint).swiftlint --strictclean on the threechanged files; BrewUILint clean over Homebrew and Sources.
checking by hand: Cmd+R on Installed leaves Doctor's "last checked"
timestamp alone, Cmd+R on Doctor moves it.
PR checklist
verification: the checks listed above, minus the two unchecked items.