Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Requires macOS 13 Ventura or later. (Pre-Ventura users: stay on
- Right-clicking the expand/collapse arrow now opens the same context menu as the separator, so Preferences is reachable from the control you already click.

### Fixed
- macOS 27 Golden Gate: hiding works again with the new single-window menu bar and native overflow button (#360). The separator stays under half the display width (macOS 27 drops items at that cliff) and spacer items cover wide and mixed-width displays; displaced icons go into the system `«` overflow instead of off-screen.
- Multi-display: the collapse width is now sized for the widest attached screen, so icons no longer leak on wider external monitors; the width re-applies on display hot-plug.
- Auto-collapse no longer fires while you are interacting with the menu bar (the timer defers and re-arms while the pointer is in the bar).
- The Preferences window no longer closes when auto-collapse fires with "use full menu bar on expanding" enabled (#170, #66, #151).
Expand All @@ -22,5 +23,5 @@ Requires macOS 13 Ventura or later. (Pre-Ventura users: stay on
- Pinned the HotKey dependency to an exact version and removed an unused file-access entitlement and dead code (no behavior change).

### Known / in progress
- macOS 27: the hide mechanism (separator-length inflation) can stop working on the re-architected menu bar (#360). This build adds diagnostics to characterize the failure; the graceful-degrade behavior and the longer-term managed-overflow redesign are tracked separately.
- New menu-bar icons can appear in the hidden zone because macOS inserts them at the far left; ⌘-drag them to the right of the separator (see the manual). A built-in pin is part of the planned redesign.
- On macOS 27 the always-hidden separator still inflates as a single unit, so with the regular section expanded its icons can show on a very wide display.
48 changes: 32 additions & 16 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,50 @@

Hidden Bar is a single-process, sandboxed AppKit menubar utility (~1.5k lines of
Swift, one dependency: [HotKey](https://github.com/soffes/HotKey)). There is no
helper app, no daemon, no network. Everything happens inside three
`NSStatusItem`s and one window.
helper app, no daemon, no network. Everything happens inside a handful of
`NSStatusItem`s (arrow, separator, optional always-hidden, plus macOS 27
spacers) and one window.

## The core trick

macOS offers no API to hide other apps' menubar icons. Hidden Bar fakes it with
geometry: a separator status item whose **length is inflated to roughly the
width of the widest attached screen**, shoving every icon to its left off-screen.
Collapsing and expanding is just flipping that length between ~20pt and the
inflated value.
geometry: a separator status item whose **length is inflated**, shoving every
icon to its left out of the visible bar. Collapsing and expanding is just
flipping that length between ~20pt and the inflated value.

On macOS 26 and earlier the inflated length is roughly twice the widest
attached screen, which pushes those icons off the left edge. On macOS 27 the
menu bar is one window with a native overflow (`«`), and the system **drops**
a status item whose length reaches half the display width. The collapse unit
is therefore sized just under half the **narrowest** attached screen, and
zero-length spacer items between the separator and the arrow inflate with it
so the total span still covers a wide or mixed-width setup. Icons the
separator displaces go into the system overflow menu rather than off-screen.

```mermaid
flowchart LR
subgraph menubar [menu bar, right to left]
direction RL
ARROW["arrow item\n(toggle, variable length)"]
SEP["separator item\n20pt expanded / ~2x screen width collapsed"]
HIDDEN["other apps' icons\npushed off-screen when collapsed"]
SPACERS["macOS 27 spacers\n(hidden expanded / collapse-unit collapsed)"]
SEP["separator item\n20pt expanded / collapse-unit collapsed"]
HIDDEN["other apps' icons\noff-screen (pre-27) or native overflow (27)"]
ALWAYS["always-hidden separator\n(optional)"]
end
ARROW --- SEP --- HIDDEN --- ALWAYS
ARROW --- SPACERS --- SEP --- HIDDEN --- ALWAYS
```

Key consequences of this design:

- The menubar replicates on every display, so the collapse length derives from
the **widest** screen (`NSScreen.screens`), never `NSScreen.main`, and is
- The menubar replicates on every display. On macOS 26 and earlier the collapse
length derives from the **widest** screen (`NSScreen.screens`), never
`NSScreen.main`. On macOS 27 it derives from the **narrowest** (the only cliff
every bar's copy of the item can clear), with spacers covering the rest. It is
re-applied to the live item on `didChangeScreenParametersNotification`
(display hot-plug).
- The length is bounded: `max(500, min(widestFrameWidth * 2, 10_000))`. macOS
enforces a hard 10,000pt maximum on `NSStatusItem.length`.
- Pre-27 the length is bounded: `max(500, min(widestFrameWidth * 2, 10_000))`.
macOS enforces a hard 10,000pt maximum on `NSStatusItem.length`. On 27 each
item stays under `narrowest/2 - 64`.
- `isCollapsed` is derived state: `separator.length > 20`, deliberately not an
equality check, so it survives the length being recomputed while collapsed.
- Icons macOS inserts to the LEFT of the separator (where new status items
Expand Down Expand Up @@ -97,9 +110,12 @@ A full-tree audit (2026-06) scored 9/10 with hygiene-level findings only.
- **The notch**: hidden icons sit "under" the notch area on notched Macs; the
trick cannot reveal them there. The real fix is a spillover/second-bar design
(tracked in issues #357/#341/#148; candidate implementations in PRs #350/#358).
- **macOS 27**: the menu bar re-architecture in macOS 27 betas
(`NSMenuBarNavigationSceneExtension`) breaks length-inflation hiding entirely
(issue #360). A different mechanism may be required.
- **macOS 27 always-hidden on wide displays**: the always-hidden separator
still inflates as a single unit, so with the regular section expanded its
icons can show on a display wider than twice that unit.
- **macOS 27 first launch after upgrade**: items register under `_v27` autosave
names so spacers land between the arrow and the separator. Icons may need a
one-time ⌘-drag past the separator, as on a fresh install.
- **Other apps' open menus**: interaction-awareness is pointer-position-based;
a pointer deep inside another app's open dropdown is below the menubar band,
so the collapse can still fire there.
24 changes: 6 additions & 18 deletions docs/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,13 @@ Source of the current state: the v1.11 issue-clearing pass (2026-06-12), branch
`fix/v1-11-batch` / draft PR #365, and SPEC-003. Core-model changes (separator length
math, collapse state machine) are HIGH RISK and require a mandatory review-team pass.

## Blocked on macOS 27 hardware (Han UAT)
## macOS 27 (landed, residual)

- **macOS 27 hide-mechanism capture (#360).** Run the v1.11 build on real macOS 27,
trigger a collapse, capture the `HideMechanism:` NSLog (requested length / host-window
width / button width / actual length). This is the unblocker: it reveals which geometry
signal separates "honored" from "ignored" on 27. Diagnostic-only instrument already
shipped. See SPEC-003 + `StatusBarController.swift` (collapse path).
- **Redesign the detection signal, then ship Option B (detect-and-degrade).** Review-team
found `btnSeparate.button?.window?.frame.width` reads the full menu-bar window width
(~1728pt on 26.5), so `honored` is trivially true on every OS. Switch to a positional
signal (separator button X-coordinate before vs after collapse). Once the 27 capture
calibrates it: re-add the one-shot post-collapse check, a one-time context-menu notice
linking #360, and stop re-inflating on confirmed failure. Depends on the capture above.
- **Fix the 3 review bugs when re-enabling degrade.** (1) move the `hideMechanismChecked`
latch to AFTER `honored` is measured (a transient nil window currently burns the
one-shot check); (2) drop the `?? requested` nil-fallback that latches detection moot;
(3) `degradeHideUnavailable()` must restore the app activation policy under
"use full menu bar on expanding", or the bar shows while the app stays `.accessory`.
`StatusBarController.swift:316,318,329`.
- **Hide mechanism restored (#360).** Collapse uses a sub-half-width unit plus
spacer items so displaced icons go into the native overflow (`«`). Residual:
always-hidden still inflates as one unit (can leak on very wide displays when
the regular section is expanded); first launch after upgrade needs a one-time
⌘-drag because items register under `_v27` names.

## Blocked on external-display hardware

Expand Down
6 changes: 4 additions & 2 deletions docs/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Everything Hidden Bar can do, including the parts with no UI.
- **Self-repair**: if the arrow or separator was ⌘-dragged off the bar (which
used to make the app unreachable forever), they come back on next launch.
- **Display changes**: plugging in or removing monitors re-sizes the hidden zone
for the widest attached screen automatically.
automatically (widest screen on macOS 26 and earlier; narrowest-plus-spacers
on macOS 27).

## Hidden settings (Terminal)

Expand All @@ -66,7 +67,8 @@ To undo any of them: `defaults delete com.dwarvesv.minimalbar <key>`.
| Login item missing after denying it once | System Settings > General > Login Items: re-enable Hidden Bar, then toggle the pref off/on |
| A ghost "LauncherApplication" login item from old versions | Launch the current version once; it deauthorizes the legacy item automatically |
| App language stuck | See the `AppleLanguages` command above, or System Settings > General > Language & Region > Applications |
| Nothing hides on a macOS 27 beta | Known (issue #360); the menu bar re-architecture broke the hiding mechanism, fix under investigation |
| Nothing hides on macOS 27 after upgrading Hidden Bar | ⌘-drag icons to the right of the separator once. macOS 27 uses new item names so positions reset like a fresh install |
| Hidden icons on macOS 27 appear under the system `«` chevron while collapsed | Expected: macOS 27's native overflow is where displaced icons go. Click Hidden Bar's arrow to bring them back onto the bar |
| A new or just-updated app's icon shows up already hidden | Expected, see "Why new icons start hidden" below; ⌘-drag it to the right of the separator once |

### Why new icons start hidden
Expand Down
4 changes: 3 additions & 1 deletion docs/RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ menu bar. Two building blocks make that scriptable:

1. **Truth signal**: the separator's AX size.
`osascript -e 'tell application "System Events" to tell process "Hidden Bar" to get size of menu bar item 2 of menu bar 2'`
reads ~20pt expanded vs ~2x-screen-width collapsed. Item 1 is the arrow.
reads ~20pt expanded vs the collapse length (pre-27: ~2x-screen-width;
macOS 27: just under half the narrowest screen, with extra spacer items).
Item 1 is the arrow.
2. **Real clicks, not AXPress**: `AXPress` on the arrow is a no-op because the
action handler reads `NSApp.currentEvent` (nil under assistive synthesis;
known accessibility defect). Post real `CGEvent` mouse clicks at the arrow's
Expand Down
Loading