Repository navigation
Let plugins add menu bar items and settings buttons, and show settings conditionally - #28
Open
masonjmiller wants to merge 2 commits into
Open
masonjmiller wants to merge 2 commits into
masonjmiller wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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."type": "button"in aconfigSchemaopens 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 nodefault; every other type still does, and a null default is still refused.showWhenon 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 onConfigSchemaEntry, so native widgets can use it too.docs/plugins/manifest-reference.mdcovers 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 allpasses: swift-format lint, zero compiler warnings, and 396 Swift Testing tests in 37 suites. Ten are new, inPluginManifestTests: 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).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
🤖 Generated with Claude Code