Options for switching workspaces
In HERE Core UI Components v12.6 or later, the confirmation dialog that's displayed when users switch to a different workspace is available from Store or Home if you choose to add the "switch workspace" functionality to them. (It's already available from Browser and Dock.) You can control whether the confirmation dialog is displayed.
You can also specify whether to keep a Browser window open when users switch to a different workspace.
In addition, you can suppress the green success popups that appear after workspace switch and save operations. See Suppress workspace success indicators.
How it works
The applyWorkspace method lets you specify the following properties:
-
skipPrompt: Default valuefalse. Set totrueto apply the workspace without displaying a confirmation dialog to the user. -
promptContainerWindowIdentity: Default value undefined. Provide child property values to customize where the confirmation dialog appears. If not set, the dialog appears on the user's default monitor. -
applySnapshotOptions.closeExistingWindows: Default valuetrue. Set tofalseto keep the workspace platform windows open when the user switches to a different workspace.
For a complete list of options, see the API reference for ApplyWorkspaceOptions
How to do it
Confirmation dialog options:
getCurrentSync().applyWorkspace(WORKSPACE_TO_APPLY_METHOD_TO,
{
// lets you customize where the confirmation dialog appears
// ignored if `skipPrompt` set to true
promptContainerWindowIdentity: {
uuid: 'testPlatform',
name: 'Test Platform'
},
// set to `true` to hide the confirmation dialog when users switch workspaces
skipPrompt: false
});
Keep windows open:
getCurrentSync().applyWorkspace(WORKSPACE_TO_APPLY_METHOD_TO,
{
applySnapshotOptions: {
// keeps the current workspace platform window open when users switch workspaces
closeExistingWindows: false,
}
});
Suppress workspace success indicators
The Browser displays green success popups after two workspace operations: switching a workspace ("Workspace Switched") and saving a workspace ("Workspace Saved").
Some platforms manage workspace persistence silently or do not present a workspace success UI to users.
In those cases, these indicators can be confusing or unwanted (for example, "Workspace Switched" fires on every applyWorkspace() call, including the initial workspace load at startup).
Starting in HERE Core UI v24, when you initialize your HERE Core UI platform, you can set optional suppression flags on the indicators property of BrowserInitConfig.
If you enable suppression, provide an accessible alternative confirmation for your users when appropriate. These popups are typically announced by screen readers as status messages; suppressing them removes that feedback entirely.
The default behavior is to show all indicators. Both flags default to false. If you omit the indicators property, success popups continue to appear exactly as they do prior to v24.
-
suppressWorkspaceSwitched: Set totrueto suppress the "Workspace Switched" indicator on allapplyWorkspace()calls. -
suppressWorkspaceSaved: Set totrueto suppress the "Workspace Saved" indicator on workspace save and save-as operations.
The flags are independent. You can enable either one without the other.
await WorkspacePlatform.init({
browser: {
indicators: {
suppressWorkspaceSwitched: true,
suppressWorkspaceSaved: true,
},
},
});