feat(macos): regroup menu bar and notify on updates instead of manual checks - #348
Merged
Conversation
…manual checks The status-item menu had grown to ~16 flat top-level items. Regroup into "主题" (background/import/saved themes/folders), "链接" (Gallery/Studio/ website), and "维护" (engine reinstall/manual update check/restore+uninstall) submenus, keeping only the two most-used actions (reapply skin, open ChatGPT) and Quit flat at the top level. Replace the always-present "检查更新…" item with a background check every 24h (plus once ~15s after launch) that posts a system notification the first time a given version is seen, and shows a top-level "🆕 发现新版本" item only while one is actually available. Manual "立即检查更新" still lives in 维护 for anyone who wants to force a check.
- Give the background and manual update-check paths a dedicated updateCheckInFlight guard so a manual click during the 24h/15s background check can't spawn a second concurrent check-update-macos.sh, and split checkForUpdates' guard so hitting that (or the busy state) shows nothing instead of a misleading "update script missing, reinstall" error. - "立即检查更新" is now also disabled while either check is running. - docs/install-macos.md still described the old click-to-check-only behavior; describe the new background+notification flow.
Merged
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.
Summary
check-update-macos.sh --json. When a new version is found, it posts a system notification the first time that version is seen (tracked inUserDefaults, so it won't renotify daily for the same release) and shows a top-level "🆕 发现新版本 vX.X.X" item only while one is actually available — clicking either opens the release page. A manual "立即检查更新" stays in 维护 for anyone who wants to force a check.Not covered
The menu bar app has no localization at all (no
NSLocalizedString/.lproj, hardcodedzh_CNstrings throughout) — out of scope here, flagged separately.Verification
NODE=$(which node) bash macos/tests/run-tests.shpasses (shell/JS static + integration suite).swift build/swift testlocally — this sandbox's Command Line Tools ship Swift 5.10 against a macOS 15.2 SDK that requires Swift 6.0.3 (pre-existing toolchain mismatch, unrelated to this change;run-tests.shitself skips the native Swift step here for the same reason). Manually re-read the full diff for signature/type correctness (caught and removed one dead parameter). CI'smacos-latestjob (swift test --package-path macos/menubar-app+ full DMG build) is the real compile gate for this PR — please don't merge until that's green, ideally with an actual click-through of the new submenu layout and one real "update available" notification since I can't screenshot a native NSMenu from here.