Hide menu bar icon#63
Open
ryan-saffer wants to merge 1 commit into
Open
Conversation
this required a rework of how the menu bar was managed. makes the preferences window the apps main window - launching the app if its already open will open preferences. ensured all menu items are in the settings as well so nothing is lost; check for updates, quit reef and showing app info (version number)
ryan-saffer
force-pushed
the
hide-menu-bar-icon
branch
from
July 1, 2026 04:54
8b11452 to
b07624c
Compare
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.
Addresses issue #49
What This Changes
This PR makes Reef behave correctly as a menu-bar/accessory app, including when the menu bar icon is hidden.
Check for updates...Quit ReefBecause Preferences is a floating window, and this adds a 'Check for updates' button in General Preferences, Sparkle's update UI could appear behind it. The update action now temporarily lowers the Preferences window while Sparkle presents its update windows, then restores Preferences to floating behaviour afterward.
Why The Refactor Was Needed
The previous SwiftUI
MenuBarExtraapproach could not genuinely hide the menu bar item. Making the icon empty or clear still left an invisible clickable slot in the menu bar, which was incorrect behaviour.To truly hide the icon, Reef needed to move to an AppKit
NSStatusItem, because AppKit lets us remove the status item fromNSStatusBarentirely.The Preferences behaviour also needed to move away from SwiftUI's
Settingsscene. In anLSUIElementapp, the standard Settings scene did not give enough control over cold launch versus hot launch behaviour. Reef now uses an explicit AppKit app entry point and an explicit Preferences window so that:Potential Improvement
If Reef is cold-launched while the
Hide menu bar iconpreference is enabled, it can feel like nothing happened (it just silently opened in the background). In this case we could open the Preferences window so it's clear the app was launched.If we did this it would need an exception for launch-at-login, because login startup should remain silent even when the menu bar icon is hidden. (This is possible and I had it working, but wasn't sure which way to go).