Add hostToolbarControl message for programmatic toolbar control via postMessage#146
Merged
Merged
Conversation
…essage Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add showSource option in hostRenderRequest message
Add hostToolbarControl message for programmatic toolbar control via postMessage
Nov 19, 2025
Collaborator
|
@copilot instead of a collection of methods for every button, lets have a single showOrHideButtons and then pass an object where keys are button names and boolean. |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Contributor
Author
Refactored to use a single Example: toolbar.showOrHideButtons({
tweak: true,
download: true,
restart: false
}); |
Collaborator
|
@copilot let's rename tweak to source |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Copilot stopped work on behalf of
danmarshall due to an error
November 19, 2025 20:51
danmarshall
marked this pull request as ready for review
November 19, 2025 21:20
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.


Enables external applications to control toolbar UI elements via postMessage without coupling to the render request message.
Changes
New Message Type
Added
HostToolbarControlMessagewith commands:showSource: boolean- Toggle source textarea visibilityshowDownloadDialog: boolean- Trigger download popup programmaticallysetFilename: string- Override download filenameshowOrHideButtons: { tweak?: boolean; download?: boolean; restart?: boolean }- Control button visibility with a single objectImplementation
HostToolbarControlMessageinterfacesetSourceVisibility(),showDownloadDialog(),showOrHideButtons())hostToolbarControlmessagesUsage
Screenshots
Show source programmatically:

Trigger download dialog:

Hide all buttons:

Show all buttons:

Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.