Repository navigation
Custom commands - #3284
Merged
Merged
Custom commands#3284
Conversation
Signed-off-by: Andrew Stein <steinlink@gmail.com>
Signed-off-by: Andrew Stein <steinlink@gmail.com>
texodus
force-pushed
the
context-menu-commands
branch
2 times, most recently
from
November 15, 2026 17:14
f9dc312 to
f2940b3
Compare
texodus
force-pushed
the
context-menu-commands
branch
from
November 15, 2026 18:57
f2940b3 to
76f0fb3
Compare
texodus
marked this pull request as ready for review
November 15, 2026 19:25
Signed-off-by: Andrew Stein <steinlink@gmail.com>
texodus
force-pushed
the
context-menu-commands
branch
from
November 15, 2026 20:55
76f0fb3 to
71b3b79
Compare
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.
This PR adds
setCommandSchema(), an API which lets an app embedding<perspective-viewer>add its own commands to the right-click menu, with click context. Also adds a newtrading-terminalexample which shows off a few of these newCommandSchematypes and logs their output:New APIs
setCommandSchema(schema, { scopes? })registers the command schema function and the surfaces it is evaluated for, or removes it with null.invalidateCommands({ panel? })re-queries the schema for every rendered button surface, coalescing calls within one task, and resolves when the plugins have redrawn.queryCommands(plugin, location, frame, refs)resolves one command list and context per ref against a plugin's retained viewport frame, without an engine call.invokeCommand(key, context)dispatches perspective-command for an app command picked by a plugin's own button.Example
Drive-bys