Media: Restore accessible name for media items without a title - #12136
Media: Restore accessible name for media items without a title#12136itzmekhokan wants to merge 7 commits into
Conversation
Changeset [62104] added an "uploading…" fallback for the grid item `aria-label` so that in-progress uploads, which have no title yet, get an accessible name. That fallback also matched saved attachments that simply have no title, so every titleless image was announced as "uploading…" in the Media Library grid view. Limit the "uploading…" fallback to items that are actually uploading, and fall back to the existing "(no title)" string for saved attachments without a title. Both strings already exist in core, so no new translatable strings are introduced. Follow-up to [62104]. Fixes #65438. See #64883.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
Hi @itzmekhokan, I verified that media items without a title are now listed as "(no title)" instead of "uploading…" in the Media Library grid view. Media items with titles remain unaffected. Screenshot attached for reference. |
|
Thanks for the PR @itzmekhokan. I can confirm this PR works as expected and the results are as @Infinite-Null showed them in the comment above. LGTM |
Build the aria-label value with an explicit if/else block instead of a nested ternary for readability. See #65438.
|
The Adjustment didnt work out for me. When the upload finished and the media library page is refreshed its again saying "uploading..." |
Thanks for testing! This change lives in the source module Please rebuild after checking out the branch: |
Changeset [62104] added an "uploading…" fallback for the grid item `aria-label` so that in-progress uploads, which have no title yet, get an accessible name. That fallback also matched saved attachments that simply have no title, so every titleless image was announced as "uploading…" in the Media Library grid view. Limit the "uploading…" fallback to items that are actually uploading, and fall back to the existing "(no title)" string for saved attachments without a title. Both strings already exist in core, so no new translatable strings are introduced. Follow-up to [62104]. Fixes #65438. See #64883.
Build the aria-label value with an explicit if/else block instead of a nested ternary for readability. See #65438.
0ac207f to
da16e3d
Compare
In the media library, the `aria-label` for an untitled image fell back to "uploading...", the string used during the upload processing. Change the values so that images only use "uploading..." during the uploading process, but otherwise use "(no title)", like other untitled items. Developed in #12136 Props jamieburchell, presskopp, khokansardar, joedolson, tusharaddweb, ankitkumarshah, chillifish, masteradhoc, cbravobernal. Fixes #65438, see #64883. git-svn-id: https://develop.svn.wordpress.org/trunk@62892 602fd350-edb4-49c9-b593-d223f7449a82
In the media library, the `aria-label` for an untitled image fell back to "uploading...", the string used during the upload processing. Change the values so that images only use "uploading..." during the uploading process, but otherwise use "(no title)", like other untitled items. Developed in WordPress/wordpress-develop#12136 Props jamieburchell, presskopp, khokansardar, joedolson, tusharaddweb, ankitkumarshah, chillifish, masteradhoc, cbravobernal. Fixes #65438, see #64883. Built from https://develop.svn.wordpress.org/trunk@62892 git-svn-id: http://core.svn.wordpress.org/trunk@62159 1a063a9b-81f0-0310-95a4-ce76da25c4cd


Saved attachments without a title were being announced as "uploading…" in the Media Library grid view. This restores a meaningful accessible name for them while keeping the upload-progress naming added in [62104].
What the problem was:
aria-labeltotitle || 'uploading…'so in-progress uploads get an accessible name.What the fix does:
Approach and why:
uploadingflag satisfies both tickets.Testing instructions:
<li class="attachment">aria-labelshould read "(no title)" (verify with a screen reader or the browser a11y inspector), not "uploading…".aria-labelstill reads "uploading…".Trac ticket: https://core.trac.wordpress.org/ticket/65438
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: Ticket and regression analysis (tracing the cause to [62104]) and drafting the one-line fix. All changes were reviewed, validated against the codebase, and are taken responsibility for by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.