Skip to content

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

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

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

Conversation

@shekharnwagh
Copy link

@shekharnwagh shekharnwagh commented Mar 24, 2026

When RTC is enabled, the "Join" action link on the post list gets stuck after the post lock expires. The heartbeat correctly clears the lock status text and CSS class, but the link text was rendered server-side at page load and never updated back to "Edit".

PR #11234 which removed post lock, conditionally rendered "Join" or "Edit" based on wp_check_post_lock() at page load. The heartbeat JS updates the lock class and status text but has no code to swap the action link.

Fix: Always render both "Edit" and "Join" as separate <span> elements and toggle visibility via CSS using the .wp-collaborative-editing class the heartbeat already manages. Also replaces aria-label with screen-reader-text spans so the accessible name stays in sync with the visible text across lock state changes.

Trac ticket: https://core.trac.wordpress.org/ticket/64622
Related #11234

@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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props shekharnwagh.

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

@github-actions
Copy link

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

When RTC is enabled, the "Join" action link on the post list was
rendered based on lock state at page load. The heartbeat correctly
cleared the lock status text and CSS class when the lock expired,
but never updated the action link back to "Edit".

This changes the approach to always render both "Edit" and "Join"
as separate spans and toggle visibility with CSS using the
`wp-collaborative-editing` class the heartbeat already manages.
When RTC is enabled, the "Edit" and "Join" action links now include
screen-reader-text spans with the post title instead of relying on
aria-label. This keeps the accessible name in sync with the visible
text as CSS toggles between "Edit" and "Join" on lock state changes.
@shekharnwagh shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from b26b107 to 00351ba Compare March 25, 2026 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant