Repository navigation
fix(mac): stop opening an empty settings window at launch - #94
Merged
dcolinmorgan merged 2 commits intoOct 19, 2026
Merged
Conversation
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.
Change: the
Settings { EmptyView() }scene gets.defaultLaunchBehavior(.suppressed), so macOS no longer opens it at launch.Why: on macOS 26.7.1, every launch of Herdi opens an empty 900×450 "Herdi Settings" window. A v0.8.0 build does the same, so the bug is older than the recent Herdi changes. There is no saved window state behind it. SwiftUI opens the lone Settings scene by itself.
macOS 14:
defaultLaunchBehaviorneeds macOS 15, and aSceneBuildertakesif #availablewith noelse. So macOS 14 gets no scene. The panel and the status item are AppKit and do not use it. I simulated that case on macOS 26 by changing the check to an OS that does not exist. The panel and the status menu worked. I could not test it on a real macOS 14 machine.Older SDKs: the CI runner (
macos-14, Xcode 15) has nodefaultLaunchBehavior. A#if compiler(>=6.0)check keeps the plain scene there, so the code compiles, but such a build still opens the window. Swift 6 ships with the macOS 15 SDK.Not used: a hidden
MenuBarExtraalso stops the window, but do not take that route. It takes the status-item slotItem-0, and macOS saves it as hidden in thecom.dcolinmorgan.herdidefaults. Herdi's own icon uses that slot, so the icon disappears, also in builds without the change.Test:
herdi-mac/build.shandherdi-mac/test.shpass. Over several launches, Herdi opens only the notch panel. The status icon shows, the menu toggles work, and the defaults are the same before and after a run.