Repository navigation
Description
What happens
On setup's first step, when hiding or showing the macOS menu bar fails, setup shows "StableBar couldn’t hide the macOS menu bar. …" and Continue stays disabled. As soon as StableBar becomes active again, for example after switching to System Settings and back, the error disappears but Continue stays disabled, and nothing says why.
Steps to reproduce
System Events has to fail the change, so this is hard to trigger by hand:
- Start setup without full Calendar access (the usual case).
- Choose Replace the menu bar while System Events fails the change, for example by timing out.
- Switch to another app, then back to StableBar.
Expected
The error stays as long as Continue waits on it, and clears once a new choice or a retry works.
Environment
main at 5f9e270, and #787 at 2a163f2. Found in code review, not reported by a user.
Evidence
CodeRabbit's review of #787: #787 (review)
Diagnosis
SetupSession.refreshAccess()(Sources/StableBar/SetupWindow.swift) runs whenever StableBar becomes active, and callspreview()unless Calendar access is full.preview()setserror = nilonce the preview loads, which also clears the error the placement step set.- On
main, the first step keeps waiting after a change that fails without taking effect, becauseplacementTookEffectsees the menu bar doesn't match. refactor: keep decisions about state in pure state machines, starting with setup's placement #787 also holds Continue after a change that throws but took effect (SetupPlacement.Phase.failed, pinned byaFailedMenuBarChangeKeepsTheFirstStepWaiting), so both cases end up stuck without an error. - Choosing the same placement again retries the change and gets out of it.
One way to fix it: keep the placement's error apart from the preview's, so a preview that loads doesn't clear it.
Related
- refactor: keep decisions about state in pure state machines, starting with setup's placement #787: adds the second case; CodeRabbit flagged it there.
- Skip setup while setup is still changing the menu bar lets the change land after setup closes #497 / fix: let Skip setup restore the menu bar when a change is still in flight #498: Skip setup while a change is still running; a failed change goes by what macOS reports.
- Skip setup while setup waits for Automation access can still hide the menu bar afterwards #788 / fix: keep Skip setup from applying a placement once Automation access is allowed #789: Skip setup while setup waits for Automation access.
Triaged by Claude Code (Claude Opus 5.5).
Activity