-
Notifications
You must be signed in to change notification settings - Fork 14
fix paste workspace #615
Copy link
Copy link
Closed
Description
Check for duplicates
- I have searched for similar issues before opening a new one.
Description
The paste context menu uses a stored workspace value that doesn't work.
In the cut/copy actions, we store the workspace the block was cut or copied from. In the paste action, we use that stored workspace. This doesn't work for a number of reasons:
- In a multi-workspace scenario, you might copy a block from one workspace, right-click on another one, click "paste" and then be surprised to find your block has pasted in a totally separate workspace than the one you clicked on.
- Doesn't work for cross-tab-copy-paste, where there might not be any value stored in the local variable for holding the workspace
- Shows the paste menu option in scenarios it doesn't make sense. We should probably only show it when a workspace is the thing that was clicked on. It doesn't make sense to, e.g. right click on a workspace comment and get a "paste" option that then pastes a block. Also, it should probably only appear if the workspace clicked on wasn't a flyout workspace, because right now you can right-click on a block in the flyout, select "paste", and then a block pastes in the main workspace behind the flyout.
I think instead the precondition should just be, is the scope.focusedNode a non-flyout workspace? if not, hide option. if yes, show option and use the focused node as the workspace we pass to paste callback.
Reproduction steps
Stack trace
Screenshots
No response
Browsers
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels