-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Cover/Video Block: Add Drag-and-Drop Support for Poster Uploads #71039
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
Cover/Video Block: Add Drag-and-Drop Support for Poster Uploads #71039
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mamaduka
left a comment
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.
Nice work, @yogeshbhutkar!
I left a couple of minor notes. I'll try to test and properly review this tomorrow.
| noticeOperations.removeAllNotices(); | ||
| noticeOperations.createErrorNotice( message ); |
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.
I don't think we should use withNotices with new components. Let's use snackbar for errors here.
P.S. Don't forget to remove all related styling.
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.
I've removed the usage of withNotices within PosterImage. Should we also refactor PostFeaturedImage to reflect the same?
* Implements a static getter for `mediaUpload`. * Removes the usage of `withNotices` as well as the corresponding styles.
Mamaduka
left a comment
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.
Nice work, @yogeshbhutkar!
What?
Follow-up to #70939
This PR adds drag-and-drop functionality for uploading posters in the Cover/Video block.
Why?
Previously, uploading an image in the new poster control required a three-step process. This update streamlines the experience by allowing users to upload images directly via drag-and-drop, making the workflow faster and more intuitive.
How?
The
DropZonecomponent was integrated directly, accompanied by anonFilesDropcallback to handle file uploads.Testing Instructions
CoverorVideoblock.Testing Instructions for Keyboard
Same.
Screencast
pr-demo-dnd.mov