Keep Wi-Fi visible when hiding other menu bar icons

Hiding pushed Wi-Fi off along with the third-party app icons. Tune the
spacer boundary to sit just left of Wi-Fi so apps disappear while the
Apple Wi-Fi, Spotlight, Clock, Battery and Control Center icons remain.

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4.1-flash
This commit is contained in:
2026-09-27 00:39:00 +08:00
parent 92a57308b7
commit 5a4e2fbda2
4 changed files with 31 additions and 19 deletions
+12 -7
View File
@@ -115,14 +115,19 @@ no control over this, so the app creates its own `NSStatusItem` and:
## Hiding other menu bar items
`MenuBarHider` creates a zero-width spacer `NSStatusItem` at launch and grows its
length to `hiddenLength` (10_000) to push the icons on its left off-screen.
Verified with `--diag-hide`:
length to `hiddenLength` (10_000) to push the icons on its left off-screen. Its
preferred position controls where the hidden/kept boundary lands:
- All third-party apps' icons go to x < 0 (cmux, Kapture, moomoo, WireGuard,
TextInputMenuAgent, Now Playing) and so does Wi-Fi.
- **Spotlight, Clock, Battery and Control Center stay**: macOS pins them to the
far right, and a third-party item can never be inserted to their right, so the
spacer has nothing to push them with. Do not try to "fix" this; it is a macOS
- Seed **250** (default) puts the boundary just left of Wi-Fi, so every
third-party app icon goes to x < 0 (cmux, Kapture, moomoo, WireGuard,
TextInputMenuAgent, Now Playing) while **Wi-Fi (x≈1173), Spotlight, Clock,
Battery, Control Center and our hamburger stay visible**.
- Verified with `--diag-hide` across positions 100–400. Below ~200 Wi-Fi gets
hidden too; above ~300 app icons (Now Playing, TextInput) leak back.
- `debug.spacerPos` (Double) overrides the seed for tuning without rebuilding.
- **Wi-Fi/Spotlight/Clock/Battery/Control Center cannot be hidden**: macOS pins
them to the far right and a third-party item can never be inserted to their
right, so the spacer has nothing to push them with. This is a macOS
constraint, not a bug.
## Gotchas