Updating the Toolbar
quip.apps.ToolbarState
This interface is used both when initializing the application via quip.apps.initialize
, and when calling quip.apps.updateToolbar(toolbarState)
menuCommands
optional
MenuCommand[];
A list of all possible menu commands for this application. See quip.apps.MenuCommand
for more details on what each menuCommand can have. To configure the visibility, active state, or appearance of these commands, use toolbarState
.
If any of the IDs have been previously registered, this configuration will override the previous configuration.
toolbarCommandIds
optional
string[]
A list of command IDs to show in the top toolbar of the app. They must be defined in menuCommands
.
If not specified, the app retains the existing list of toolbar buttons.
disabledCommandIds
optional
string[]
A list of command IDs that should be shown as disabled in toolbar menus. They must be defined in menuCommands
.
If not specified, the app retains the existing list of disabled command IDs.
highlightedCommandIds
optional
string[]
A list of command IDs that should be shown as highlighted in toolbar menus. They must be defined in menuCommands
.
If not specified, the app retains the existing list of highlighted command IDs.
destructiveCommandIds
optional
string[]
List of command IDs that should be shown as destructive in toolbar menus. They must be defined in menuCommands
.
If not specified, the app retains the existing list of destructive command IDs.
mobileToolbarCommandIds
optional
string[]
A list of command IDs to show in the mobile toolbar. They must be defined in menuCommands
.
If not specified, the app retains the existing list of mobile command IDs.
quip.apps.updateToolbar
Function(toolbarState: ToolbarState) => void
Sends a message to the host to update various attributes of the menu commands available in the toolbar. This can update the configuration of the commands, which commands appear as top-level buttons in the toolbar, and also designate which commands should be disabled or highlighted in the menus.
Simply: call this method every time you need to update the toolbar.