Skip to content

feat: show macOS 26 icons beside standard commands in app menus - #324

Closed
M4n0x wants to merge 1 commit into
mainfrom
feat/322-menu-item-icons
Closed

M4n0x wants to merge 1 commit into
mainfrom
feat/322-menu-item-icons

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Problem

Fixes #322. On macOS 26, native menus show an icon beside standard commands (About, Settings…, Hide, Quit, Undo, Copy, Paste…). StableBar's app menu popups, which also serve the Apple menu and the menus opened from Menu bar items (such as Docker Desktop's), showed text only.

Accessibility can't supply those icons. It gives each item's title, shortcut, check mark and enabled state, but no image and no action, and macOS 26 picks its automatic menu icons from the item's action selector, never its title. Icons an app sets itself, such as Docker's Dashboard and account pictures, can't be read at all. The popup's theme and StableBar's own submenus stay, so opening the real macOS menu was not an option.

Changes

  • AppMenu.swift. Each entry gets a symbol on macOS 26: AppKit's icon for that standard command, matched by English title (menuTitleSymbols, plus About …, Quit …, Undo …, Redo … and … Help) or else by its usual shortcut (menuShortcutSymbols, for menus in other languages). ⌘P is left out because some apps use it for Go to File. The shortcut is read only when the title doesn't match, so most items cost no extra Accessibility call.
  • The table comes from AppKit. I read it from AppKit on macOS 26.6 by adding items with each standard selector to a menu and reading the icon AppKit gave them. Quit, Hide, Hide Others, Paste and Match Style and Paste and Retain Style use AppKit's own images (Quit_app, Hide_app…), which load by name. AppKit's Help (tips) and Emoji & Symbols (emoji.face.grinning) icons are private system symbols, so questionmark.circle and face.smiling stand in.
  • PopupView.swift. AppMenuList keeps an 18 pt icon column on every row when any item in the menu has an icon, so titles line up as in native menus. Menus without icons look as before.
  • Older macOS. macOS 14 and 15 keep text-only menus, as their own menus have no icons.
  • docs/widgets.md. The App menus section describes the icons and what can't be shown. I kept the sentence out of the Menu bar items paragraph because feat: open the Menu bar items row on hover #321 edits the lines around it.

Testing

  • swift test on this branch, rebased on main: 294 XCTest and 458 Swift Testing tests pass.
  • appMenuEntriesShowTheSymbolsMacOSGivesStandardCommands reads a fake Docker-style menu through the injected Accessibility reader. It checks matches by title (Settings... with three dots too), by shortcut for German titles (⌘Q, ⌥⌘H), and no icon for ⌘P, ⇧⌘Q or app-specific items.
  • everyMenuSymbolDraws draws every symbol in the tables through the row's own menuSymbol and checks it has a size. It caught the two private system symbols above.
  • Rendered offscreen through PopupView with fixture menus: Docker Desktop's menu (as in the report), a Safari app menu and an Edit menu. Built-in, Paper and Rosé Pine, light and dark. Before is main, after is this branch:
Built-in, dark Built-in, light
After: Paper, light After: Rosé Pine, dark
  • face.smiling turns solid in dark mode. That's the symbol's own design, the same in a plain Image(systemName:).
  • Not checked by the agent: a live bar with real apps' menus, since this session has no Accessibility access, and the macOS 14/15 path, which returns no symbols behind #available(macOS 26, *).

Merging

One commit. A merge commit or rebase merge keeps it in the changelog.

Claude Opus 5.5 via Claude Code

Accessibility gives a menu item's title and shortcut but no image, and macOS 26
picks its menu icons from the item's action, which Accessibility doesn't share.
Standard commands now get the icons AppKit gives their actions, matched by title
in English menus and by their usual shortcut otherwise. AppKit's own Quit and
Hide images load by name; its private Help and Emoji ones get public symbols.
Menus with an icon keep an icon column on every row, as native menus do.
Earlier macOS versions keep text-only menus.

Closes #322
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 26, 2026 10:41
@M4n0x

M4n0x commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Closing without merging. macOS Accessibility gives a menu item's title and shortcut but no image and no action, so StableBar can only guess icons for standard commands. Apps that draw their own icons, such as Docker, would still lose them, and some items would gain icons their native menus don't show. Partial icons look worse than consistent text-only menus, so we're keeping text-only menus. Details in #322.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show icons beside standard commands in app menus on macOS 26

1 participant