feat: Added button to Advanced Playground to import state. #2483
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.
The basics
The details
Resolves
Fixes: #2206
It also fixes an unreported bug where importing XML duplicated all blocks.
Proposed Changes
Adds a button between the editor tabs and the "Auto" checkbox to import the tab editor contents to the workspace, reusing the existing logic that is accessible via the right-click context menu or the ctrl-enter keyboard shortcut.
Also there was a bug in the existing logic for importing from XML, where the imported blocks would be added on top of any existing blocks in the workspace without first clearing the workspace. The logic has been updated to clear the workspace first.
The new button is hidden when a tab other than the XML or JSON tab is selected.
The new button looks like this:

Reason for Changes
It's hard for users to discover the option to import via the right click menu.
Test Coverage
N/A
Documentation
None, although having a visible button is an improvement over the context menu.