RTC: Fix Edit/Join row action invisible on mobile in post list#78597
Conversation
The Edit/Join row action wrapped its visible label two `<span>` levels
deep inside the action's `<a>`:
<a href="…">
<span class="edit-action-text">
<span aria-hidden="true">Edit</span>
<span class="screen-reader-text">Edit "…"</span>
</span>
<span class="join-action-text">…</span>
</a>
WP core's responsive list-table CSS at <=782px sets
`.row-actions span { font-size: 0 }` and restores `font-size: 13px`
only on `.row-actions span a`, not on descendant spans. Because the
visible label sat inside nested `<span>`s rather than directly inside
the `<a>`, the label rendered at 0px and disappeared on mobile.
Render two sibling `<a>`s sharing the same `href` instead, each
carrying its visible label as a direct text child and the
post-specific descriptive name on `aria-label`. This matches the
row-action shape WP core uses for View/Trash/etc., satisfies core's
mobile font-size rule, and preserves the CSS-only Edit↔Join toggle
the original filter (WordPress#76795) was designed around — the `.wp-locked`
class the heartbeat maintains now selects which `<a>` is visible
rather than which inner `<span>`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @taipeicoder! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
shekharnwagh
left a comment
There was a problem hiding this comment.
Thank you for working on this !
At smaller widths (<=782px), posts that are not being edited elsewhere show both Edit and Join. For the post that is being edited elsewhere, only Join is shown, but it is offset/misaligned compared with the other row actions. It works fine on larger widths (<=782px).
Screenshots:
Small screen (
<=782px)
![]() |
![]() |
|---|---|
Small screen <782px, no post being edited elsewhere |
Small screen <782px, one post being edited elsewhere |
Large screen (
>782px)
![]() |
![]() |
|---|---|
Large screen >782px, no post being edited elsewhere |
Large screen >782px, one post being edited elsewhere |
The likely cause is the interaction with core’s responsive list-table CSS. At <=782px, core applies .row-actions span a { display: inline-block; ... }, which is more specific than .join-action-text { display: none; }, so the hidden Join link becomes visible on unlocked rows. For locked rows, .wp-locked .join-action-text { display: inline; } overrides core’s mobile inline-block, causing the alignment difference.
Review feedback on the previous commit identified two follow-on issues
at <=782px in the post-list Edit/Join row action:
- Both Edit and Join were visible on unlocked rows, because core's
`.row-actions span a { display: inline-block }` (specificity 0,1,2)
outranked `.join-action-text { display: none }` (0,1,0) on the <a>.
- On locked rows the visible Join link was misaligned with sibling
row actions, because `.wp-locked .join-action-text { display: inline }`
overrode core's `inline-block` value on the <a>.
Wrap each <a> in a <span> carrying the toggle class. Core's mobile rule
targets <a> specifically (`.row-actions span a`), and our class
selectors now match a <span>, so the two no longer compete on the
cascade: core continues to style the visible <a> exactly like sibling
row actions, and our class selectors hide/show the wrapping <span>. The
visible label is still a direct text child of <a>, so core's mobile
font-size rule still reaches it — the original "0px on mobile"
regression remains fixed. No CSS changes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@shekharnwagh nice catch. Your note on CSS specificity was indeed the cause of the regression. |
shekharnwagh
left a comment
There was a problem hiding this comment.
Works now on both small and large screens. Thank you for fixing this !




What?
Related to #76795.
Fixes the Edit/Join row action being invisible at
<=782pxonwp-admin/edit.phpwhen RTC is enabled.Why?
The
editrow action wraps its visible label in two<span>levels inside the action's<a>. WP core's responsive list-table CSS at<=782pxsets.row-actions span { font-size: 0 }and restores13pxonly on the action's<a>, expecting the visible label to be a direct text child of<a>(as it is for View/Trash/etc.). With the nested spans, the visible Edit/Join word matches thefont-size: 0rule directly and renders at 0px on mobile.How?
Render the two states as sibling
<a>s sharing the samehref, with the visible label as a direct text child of each and the descriptive accessible name onaria-label. The existing.wp-lockedCSS selectors ingutenberg_post_list_collaboration_styles()continue to drive the toggle — class names move from the inner<span>s onto the<a>s, nothing else changes. Heartbeat behavior is untouched.Before:
After:
Two
<a>s are needed because CSS can hide/show whole elements but can't swap an element's text — keeping the toggle purely CSS-driven requires both labels in the DOM. Usingaria-labelmatches WP core's row-action convention for View/Trash/etc.Testing Instructions
trunk, visitedit.php?post_type=postat viewport<=782px→ "Edit" label invisible (regression repro). On this branch, label is visible.>782px), confirm Edit/Trash/View/Quick Edit are unchanged vstrunk.<a>; each<a>has a post-specificaria-label; both share the samehref.Use of AI Tools
Investigation, root-cause analysis, and the patch were drafted with Claude Opus 4.7 (1M context) via Claude Code, reviewed and accepted by the human author per the WordPress AI Guidelines.