-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Consolidate disparate "copy block" actions #23088
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import { __, sprintf } from '@wordpress/i18n'; | |
*/ | ||
import { getPasteEventData } from '../../utils/get-paste-event-data'; | ||
|
||
function useNotifyCopy() { | ||
export function useNotifyCopy() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey Miguel, thanks for the feedback!
I believe it's a good abstraction as it does one thing: notifies the user of a copy/cut action. Every such action should have consistency about the way a user is notified. |
||
const { getBlockName } = useSelect( | ||
( select ) => select( 'core/block-editor' ), | ||
[] | ||
|
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.
Have you weighed the benefits of combining notify and flash somewhere — maybe at the action level?
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.
Of course I thought about combining them, but since
flashBlock
is used only ifone
block is copied/cut, didn't seem to me soconsistent
with the handling of the same actions with more blocks. So I think thatCopyHandler
might need more thought about this consistency in the future.With the above said, I believe I need some more experience with the project, to understand it better and feel more comfortable before starting making more design decisions. I'm observing a bit more for now :)
Great thought provoking feedback Miguel! Really appreciate it!