Skip to content

fix paste workspace #615

@maribethb

Description

@maribethb

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:

  1. 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.
  2. Doesn't work for cross-tab-copy-paste, where there might not be any value stored in the local variable for holding the workspace
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions