Skip to content

Let plugins add menu bar items and settings buttons, and show settings conditionally - #28

Open
masonjmiller wants to merge 2 commits into
kemalandic:mainfrom
masonjmiller:plugin-menu-items
Open

masonjmiller wants to merge 2 commits into
kemalandic:mainfrom
masonjmiller:plugin-menu-items

Conversation

@masonjmiller

@masonjmiller masonjmiller commented Oct 9, 2026 •

Copy link
Copy Markdown

What does this PR do?

Gives a plugin a way into its companion app, or its settings page, from the Mac side: items in EdgeControl's menu bar menu, and buttons in a widget's settings. It also lets any settings field show only while another field has a certain value.

Why

A plugin whose settings or companion app live outside the dashboard can't be found from the Mac: its tile is on the dashboard display, and the menu bar menu only has Settings and Quit. A plugin with a companion app (an editor for something the touch screen is no good at, say) has no way to open it. And a widget's settings show every field whatever the others say, though some only mean anything in one mode.

How

  • menuItems (manifest, optional) adds items between Settings… and Quit. Each opens one thing when chosen:
    • openApp: an app by bundle ID, which must be from the plugin's own developer. Its first two parts must match the plugin ID's, so a plugin can open its helper but not Terminal. An app that's already running is asked to reopen, which is when a companion app shows its window. The item is dimmed while the app isn't installed.
    • openURL: an http or https page.
    • Items from disabled plugins, and items that ask for anything else, don't appear. The menu is rebuilt each time it opens, since plugins come and go while the app runs.
  • "type": "button" in a configSchema opens an app or a page by the same rule, from the widget's settings. A button that asks for anything else isn't shown. It holds no value, so it needs no default; every other type still does, and a null default is still refused.
  • showWhen on any field, { "key": "mode", "is": "Deck" } or a list of values, shows it only while that field has one of them. A field not set yet counts as its default. It's on ConfigSchemaEntry, so native widgets can use it too.
  • docs/plugins/manifest-reference.md covers all three, including how a button looks on versions without this change (an empty text field), so plugin authors can plan for that.

Testing

  • Scripts/ci-local.sh all passes: swift-format lint, zero compiler warnings, and 396 Swift Testing tests in 37 suites. Ten are new, in PluginManifestTests: menu items decoding, which apps and pages an item or a button may open, buttons decoding without a default while other fields still need one, a button the plugin may not open being dropped, and conditions (one value or a list, the default while unset, toggles).
  • On a XENEON EDGE (macOS 27.2) with a plugin that uses all three: its menu item opens its companion app, and its settings button appears only in the mode it applies to and opens that app.

Screenshots

No changes to existing screens. It adds the plugin items to the menu bar menu, and the buttons and conditional fields described above to a widget's settings.

Checklist

  • Tested on macOS 14+ (macOS 27.2)
  • No third-party dependencies added
  • Follows existing code style

🤖 Generated with Claude Code

masonjmiller and others added 2 commits October 9, 2026 14:01
A plugin whose settings or companion app live outside the dashboard has
no way to be found from the Mac's side: its tile is on the dashboard
display, and the menu bar menu only has Settings and Quit. A new optional
manifest field, menuItems, adds items between them. Each opens one thing
when chosen: an app (openApp, by bundle id) or an http(s) page (openURL).

An app must be from the plugin's own developer: its bundle id's first two
parts must match the plugin id's, so a plugin can open its helper but not
Terminal. If the app is already running it's asked to reopen, which is
when a companion app shows its window; while it isn't installed, the item
shows dimmed. Items from disabled plugins, and anything else, don't
appear. The menu is rebuilt each time it opens, since plugins can be
installed, removed or disabled while EdgeControl runs.

The App Drawer plugin uses it for "Edit Decks…", which opens the deck
editor in its helper app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vant

A plugin with a companion app had no way into it from the widget's own
settings, and every setting showed whatever the others said, though some
only mean anything in one mode.

A configSchema field of type "button" opens one of the plugin's own apps
or a web page, by the same rule as a menu item: an app's bundle id must
start with the plugin's developer prefix. A button asking for anything
else isn't shown, and one whose app isn't installed is dimmed. It holds no
value, so it needs no default; every other type still does.

Any field can carry showWhen, { "key": "mode", "is": "Deck" } or a list of
values, and then shows only while that field has one of them, counting a
field not yet set as its default. It's on ConfigSchemaEntry, so native
widgets can use it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant