Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Copy/Cut/Paste blocks #2326

Closed
pinarol opened this issue May 27, 2020 · 1 comment · Fixed by #2378
Closed

Proposal: Copy/Cut/Paste blocks #2326

pinarol opened this issue May 27, 2020 · 1 comment · Fixed by #2378
Labels
Project: Flow improvements Revise/enhance various editing flows [Type] Enhancement Improves a current area of the editor

Comments

@pinarol
Copy link
Contributor

pinarol commented May 27, 2020

  1. Currently there’s no way to move a block inside/outside of nested blocks which is a big missing piece. Cut/Paste can be a quick way to support this.

  2. When I style a button block I feel the need to just copy the same button near it. Currently you can only add a new Button block from scratch. Copy paste can be a quick way to cover these kinds of needs. Button block is just an example but we'll keep on adding more style options to the blocks.

Copy/Cut/Paste is a popular paradigm so I feel like we can have a quick win feature here without needing to complicate the editor.

What I have in mind is just putting the copy/cut options to the new block menu we have. (The one that also has the Trash icon.)

Again if sth has been copied or cut, we could show options there like Paste after this, Paste before this.

cc @iamthomasbishop

@iamthomasbishop
Copy link
Contributor

Currently there’s no way to move a block inside/outside of nested blocks which is a big missing piece. Cut/Paste can be a quick way to support this.

I agree w/ your general assessment, this would be a really natural thing to have. I think there are 2 main considerations in my mind — using the native Edit/Selection Menus (mostly tied to richText blocks) and copy/paste via the ••• menu on the inline toolbar.

The obvious path on the RN side is the ••• menu options. When the user taps ••• we should show options to Copy block and Paste block (if there is one in the clipboard). If the user has copied a block to their clipboard, tapping on Paste block would show a sheet that is similar to the one we show when users long-press the inserter button. This would show options for Paste block before, Replace current block (if this is an empty block), and Paste block after. That flow would look like this:

Alternatively, using the native Edit/Selection Menus would work something like this: When the user taps a richText input, we inherently show the Edit/Selection Menu, which shows options for copy/paste/etc. If the block is empty, we skip straight to replacing the empty block with the one from the clipboard. If the block has contents, we show the position sheet (paste above, below, replace current block). That would look like this (example uses an empty paragraph block):

Any thoughts on this? I imagine the easier part will be the RN side, but let's discuss.

@pinarol pinarol added [Type] Enhancement Improves a current area of the editor Project: Flow improvements Revise/enhance various editing flows and removed [Status] Needs Discussion labels May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: Flow improvements Revise/enhance various editing flows [Type] Enhancement Improves a current area of the editor
Projects
None yet
2 participants