-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
List View: Add keyboard shortcut for duplicating blocks #53559
Conversation
Size Change: +2.8 kB (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Hrm, looks like the altered e2e test is failing, even though it's passing locally. I'll look into it further. |
This PR makes it a whole lot more consistent when selecting multiple blocks, at least on Chrome, which shares that shortcut with the bookmark manager Before ⚰️2023-08-14.15.24.57.mp4After 🎉2023-08-14.15.26.41.mp4 |
Thanks for taking this for a spin @ramonjd!
Switching to |
What is the shortcut for Windows? |
@alexstine I believe the Windows shortcut will be Control + Shift + D, which should be the same as in the editor canvas. My Windows VM is playing up this morning so I haven't been able to test manually. Let me know if you run into any issues with it, though, and I can follow up. |
This sounds right! Just tested this branch on Edge + Windows 10. The following video demonstrates that the correct key mapping shortcut (Control + Shift + D) is displayed in the listview context menu. Also, using the shortcut duplicates the selected block. 2023-08-15.11.04.19.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewserong Found one bug but otherwise, this is working well.
- Insert some blocks in the post editor.
- Open the list view.
- Duplicate a block with the keyboard shortcut.
- Notice how you are not moved to the duplicated block.
- Use the Duplicate option from the block Options menu.
- Notice how focus moves to the duplicated block.
Should the keyboard shortcut also move focus to the newly duplicated block?
Thanks for the detailed testing @alexstine! I've pushed an update, and I think the behaviour should now match what happens in the block options menu (focus is shifted to the duplicated block now). Let me know if you run into any further issues, of course. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well for me. 👍
Thanks for re-reviewing! |
What?
Part of: #49563
Within the List View, enable handling for the keyboard shortcut to duplicate blocks.
Why?
So that while navigating around the list view via keyboard, you can quickly duplicate the selected (or focused) blocks without needing to change focus to another area (i.e. the block settings menu or the editor canvas).
How?
Testing Instructions
CMD+Shift+d
to duplicate the block. This should work!CMD+Shift+d
— nothing should happen as only one Footnotes block is allowed on a post or page.Screenshots or screencast
In the below screengrab, Paragraph blocks are duplicated via the keyboard shortcut. Then, a selection that includes a Footnotes block is made, and the keyboard shortcut is attempted again, and nothing happens (which is expected).
2023-08-14.14.21.49.mp4