Skip to content

feat: open the Menu bar items row on hover - #321

Merged
M4n0x merged 1 commit into
mainfrom
feat/menu-bar-items-hover
Oct 26, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/menu-bar-items-hover

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Menu bar items widget lists the items of the hidden macOS menu bar only after a click, so reaching a status item takes two clicks. The menu bar it stands in for opens as soon as the pointer reaches it. Fixes #320.

Changes

  • Opens on hover by default. Once the pointer rests on the widget for the hover delay (bar.hoverDelay, 400 ms by default), the row opens. It stays open while the pointer is over the widget or the row and closes once it leaves both, as popups with popup.openOnHover do. Clicking the widget keeps the row open until you click elsewhere or click the widget again; before, a click on an open row always closed it.
  • Click mode. "openOnHover": false on the widget, or Open on hover off in Settings → Bar → Behavior, brings back click to open and click to close. The key is on the widget, like App menus' expandOnHover, because setting popup on this widget replaces its row. Reset in Settings clears it.
  • No prompt on hover. menuBarItemsPopup(requestingAccess:) skips the Accessibility request when the row opens on hover, so passing over the widget never brings up the prompt or System Settings. A click still asks.
  • Waiting for the row. The row's items are read through Accessibility when it opens, after the hover delay. WidgetPopup.hover now awaits its show inside the hover task, so leaving the widget, or a click that opens the row first, cancels a read in progress and the row doesn't open after the pointer has gone.
  • A click on an open popup. WidgetPopup.toggleIfOpen holds what toggle did for a popup already open under its widget: keep one opened on hover, close one opened by a click. The widget calls it before reading the row, so it doesn't read the items just to close it.
  • Surfaces. Decoder and stablebar.schema.json (openOnHover), Settings (Behavior toggle, Reset), and the guide (docs/widgets.md: the widget table and Menu bar items). Includes, templates, profiles and overrides carry the key like any widget property, and --set needs no change. No example uses this widget.

Testing

  • New tests: decoding (openOnHover defaults to true, false is kept), a hover whose popup is read first opens only if the pointer stays, a click keeps a hover-opened popup and closes a clicked one, and Reset clears openOnHover. Each failed before the change.
  • swift test on this branch rebased on main: 294 XCTest and 459 Swift Testing tests pass.
  • Settings → Bar → Behavior for a Menu bar items widget, drawn offscreen from a scratch configuration, before (main) and after. The new switch is on; offscreen it's drawn in an inactive window's grey.
Before After
  • Not checked: hovering the widget on a running bar. That needs a dev build with Accessibility access, and the row itself looks the same as before. The hover path uses the same WidgetPopup calls as popups that open on hover.
  • git diff --check and commitlint pass.

Merging

A merge commit or rebase merge, which keeps the one commit. As a feat, it makes a minor release.

Claude Opus 5.5 via Claude Code

The Menu bar items widget now lists the menu bar's items once the pointer
rests on it for the hover delay, and keeps them open like a popup with
openOnHover. Set openOnHover to false, or turn off Open on hover in the
widget's Behavior settings, to open the row on click as before. Hovering
doesn't ask for Accessibility access; a click still does.

Fixes #320
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 26, 2026 10:24
@M4n0x
M4n0x merged commit e01ddb8 into main Oct 26, 2026
7 checks passed
@M4n0x
M4n0x deleted the feat/menu-bar-items-hover branch October 26, 2026 10:37
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open the Menu bar items row on hover

1 participant