Repository navigation
Conversation
Add a settings sheet with two new toggles for customizing the menu bar item: - "Show percentages in menu bar" — switch between the bundled OpenCode logo (default) and three colored percentage pills (rolling/weekly/monthly) - "Launch at login" — register the app via SMAppService.mainApp so it starts automatically when the user logs in Implementation notes: - MenuBarRenderer renders to NSImage so per-character foreground colors survive the MenuBarExtra label pipeline (which drops foregroundStyle and clips multi-view containers). 13pt semospaced semibold text on rounded-rect pills tinted green/yellow/red at full saturation with white text. Falls back to a darkGray "—" pill until stats arrive. - LaunchAtLogin wraps SMAppService.mainApp; idempotent setEnabled(_:) throws on rejection, reads/writes system status directly (no UserDefaults cache to drift). - MenuBarStyle enum (.logo / .badges) persisted via AppSettings; the App reads it via @AppStorage so the menu bar reacts instantly.
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.
Adds two new toggles to the settings sheet for customizing the menu bar item:
SMAppService.mainAppso it starts automatically when the user logs in.Implementation
MenuBarRendererutility renders the menu bar item toNSImageso per-character foreground colors survive theMenuBarExtralabel pipeline (which otherwise dropsforegroundStyleonTextand clips multi-view containers to the first child).LaunchAtLoginservice wrapsSMAppService.mainApp; idempotentsetEnabled(_:), throws on rejection, reads/writes system status directly (noUserDefaultscache to drift).MenuBarStyleenum (.logo/.badges) persisted viaAppSettings; the App reads it via@AppStorageso the menu bar reacts instantly when the setting changes.Notes
swift build,swift test(12/12 pass),swiftformat --lint .all clean.