fix: blocks being dragged behind toolbox (re-re-add drag surface) #7619
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 #7354
Proposed Changes
Adds a layer manager to keep track of what layers we have (dragging layer, block layer, and bubble layer) and what order they should be in.
The new system should be entirely internal.
Reason for Changes
Needed to add a dragging layer so that blocks could exist in front of the toolbox while dragging, so I just decided to implement a better layer management system at the same time. This prepares us to easily add new layers in the future if we need to.
There are still parts of blockly that are directly accessing the block and bubble layers, these can be moved to use the layer manager.
Test Coverage
Added tests to make sure the layer manager properly handles adding new layers, and appending elements to the drag layer.
Manually tested that dragging elements and the worskpace seems to work properly, with the correct draw order.
Documentation
N/A
Additional Information
I know the issue said to just hard code a drag layer in there, but I didn't see a need to since I'm not working on anything else atm.