Skip to content

RTC: Fix stuck "Join" link in post list when lock expires#76795

Open
shekharnwagh wants to merge 2 commits intoWordPress:trunkfrom
shekharnwagh:fix/rtc-post-list-action-link
Open

RTC: Fix stuck "Join" link in post list when lock expires#76795
shekharnwagh wants to merge 2 commits intoWordPress:trunkfrom
shekharnwagh:fix/rtc-post-list-action-link

Conversation

@shekharnwagh
Copy link
Contributor

@shekharnwagh shekharnwagh commented Mar 25, 2026

What?

Fixes two post list issues when RTC is enabled:

  1. The "Join" action link gets stuck after the post lock expires
  2. Checkboxes are hidden on locked post rows

Why?

PR #76322 conditionally rendered "Edit" or "Join" based on wp_check_post_lock() at page load. The heartbeat correctly clears the .wp-collaborative-editing class and lock status text when the lock expires, but never updates the action link text back to "Edit".

Additionally, on WordPress < 7.0 (where the Gutenberg compat layer handles RTC), the CSS selectors that re-enable checkboxes on locked rows used .wp-locked, but core's list-tables.css uses tr.wp-locked which has higher specificity — so the override never took effect. This doesn't affect WordPress 7.0+ where the styles live directly in core's stylesheet with correct specificity.

How?

  • Always render both "Edit" and "Join" as separate <span> elements in the row action link
  • Toggle visibility via CSS using the .wp-collaborative-editing class the heartbeat already manages
  • Replace aria-label with screen-reader-text spans so the accessible name stays in sync with the visible text across lock state changes
  • Fix CSS specificity for checkbox and inline edit overrides by adding the tr element selector to match core's tr.wp-locked

Same approach as the corresponding WordPress core fix: WordPress/wordpress-develop#11346

Testing Instructions

  1. Enable RTC (Settings → Writing → Collaboration)
  2. Log in as User A in one browser, open a post
  3. Log in as User B in another browser, join the same post, then navigate to the Posts list
  4. Verify the locked post shows "Join" link and "Currently being edited" text
  5. Verify the checkbox is visible on the locked post row
  6. Have User A leave the post
  7. Wait for the lock to clear (~150s) on User B's post list
  8. Verify "Currently being edited" text disappears and "Join" reverts to "Edit"

@shekharnwagh shekharnwagh self-assigned this Mar 25, 2026
@shekharnwagh shekharnwagh added [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Bug Fix labels Mar 25, 2026
@shekharnwagh shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from 889156d to 4f3a9f3 Compare March 25, 2026 03:26
@shekharnwagh shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from 4f3a9f3 to ae45fc9 Compare March 25, 2026 11:41
@shekharnwagh shekharnwagh marked this pull request as ready for review March 25, 2026 11:43
@github-actions
Copy link

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@maxschmeling maxschmeling added the Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 25, 2026
shekharnwagh and others added 2 commits March 25, 2026 22:13
Always render both "Edit" and "Join" as separate spans in the row
action link and toggle visibility via CSS using the
.wp-collaborative-editing class the heartbeat already manages.

Replaces aria-label with screen-reader-text spans so the accessible
name stays in sync with the visible text across lock state changes.
The CSS selectors used `.wp-locked` to override core's hidden
checkbox, but core's list-tables.css uses `tr.wp-locked` which
has higher specificity. The `display: revert` rule never took
effect, leaving checkboxes hidden on locked rows.
@shekharnwagh shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from ae45fc9 to 042578f Compare March 25, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport to WP 7.0 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Bug Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants