Repository navigation
Block Library: Show media type icons in the inspector media control - #86170
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +301 B (0%) Total Size: 8.66 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in
|
|
Hi @t-hamano @jameskoster @jasmussen, When you have a moment, could you please review this PR? I've worked on what was discussed in this comment: #66563 (comment) I'd appreciate your feedback on this. |
|
Drag and drop already works, @t-hamano demoed it here, so the gap is a static hint, not the interaction. Happy to add the dashed outline or whichever you prefer. Could we ship this as is and improve from there? The featured image alignment feels like its own issue. Happy to hear what others think on this? |
|
Shipping and iterating is fine imo 👍 |
|
Noting #86732 is related. |
Agree with this. It's the same sentiment I wanted to communicate in #66563 conversation. Where I disagree is that dashed border communicates the drag-and-drop interaction. The same interaction in an image via image block does not have any visual indicator for this. So I would not say there is a consistent language for this interaction. However, I like the idea of a text, but it seems this is a help text, and therefore, outside and below the container. |
|
Thanks both. @t-hamano would you be able to take a look when you have a moment? Two points are still open, and I'd suggest handling them as follow-ups rather than here. Happy to open issues for both once this ships:
|
The image block doesn't need a visual affordance because the text in the placeholder already informs the user they can drop files. The issue is when there isn't text. I think the UI should somehow indicate users can drop files otherwise they have to guess. So it's a choice; add the text, or add some visual affordance (could be a dashed border, could be something else). |
| const MEDIA_TYPE_ICONS = { | ||
| audio: audioIcon, | ||
| video: videoIcon, | ||
| }; |
There was a problem hiding this comment.
Currently, no block passes audio (or a non-image/video type that falls back to fileIcon) to MediaControl. Is this in preparation for adding the Media section to the Audio, Video, and File blocks in the future?
There was a problem hiding this comment.
Yes, Aki. I added this intentionally with future PRs in mind. If you feel it doesn't look right at the moment, I can remove it now and we can add it back later.
Good point. #86732 seems a better place to continue the pattern discussion. I see the evolution of this consuming the outcome of that work. Regarding the before and after image attached by @t-hamano, it looks correct to me |
t-hamano
left a comment
There was a problem hiding this comment.
I think this looks good for now. In the future, we might be able to update the design as shown in #86732 (comment).


Part of #66563. Follows the design in #66563 (comment).
What?
+when no media is set.Why?
Blocks without an image preview, like Video and Audio, left an empty box beside the label.
Testing Instructions
+.Screenshots
Screen.Recording.2026-11-02.at.2.18.47.PM.mov
cc @WordPress/gutenberg-design for a quick visual check.