Repository navigation
Media Editor Route: Try placing file type and file size in the header - #86154
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: 0 B Total Size: 8.58 MB
⚡ 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 in
|
c7dc6d4 to
c85edcc
Compare
| @@ -86,6 +146,12 @@ function MediaEditorRoute() { | |||
| ); | |||
|
|
|||
| const title = getMediaTitle( media || null ); | |||
There was a problem hiding this comment.
I think we need to check the active record for the title. From what I can tell, restoring a cropped image to the original doesn't restore the title here.
|
While testing I noticed that you cannot clear the title field. Not really sure what the best fix here is, it's confusing UX, but I get that it's a guard against empty titles. Trying an alternative here: |
|
Thanks @ramonjd!
I'll actually merge this PR as-is because I'm not too sure yet if for the route-based approach if we want to restore in place, or actually just re-route / navigate to the original instead. For the modal restore-in-place is the best way to do it, but for the route there could be other options. So I'll merge, and have a play in follow-up(s).
Thanks for digging into that! |
|
PR for trying out fixing up the restore original behaviour for the route-based media editor: |


What?
Part of #72734
In the Media Editor Route experiment, add the file type and file size to the header. Also, truncate the Title when it runs on too long.
Why?
Overall, to continue polishing the header in the experiment.
This is an exploration into expanding how we use the header for this route. There are heaps of different ways we could use this header but these are the decisions I made while narrowing down to what I'm trying in this PR:
This PR doesn't solve other challenges like the placement of the undo/redo buttons, etc. But I'm keen to explore those sorts of things in follow-ups further down the track.
How?
filenamefield if available, and extract the file extension from itfilesizefieldAs always with these sorts of PRs, this is a bit of an opinionated change. Happy to go with other iterations if there are better ideas!
Testing Instructions
Screenshots or screencast
A normal length title in a screen size with lots of room:
A long title getting truncated on a screen size with not very much room:
Non-image media (in this case, a PDF):
Use of AI Tools
Claude Code (Opus 5.5)