RTC: Fix stuck "Join" link in post list when RTC lock expires#11346
RTC: Fix stuck "Join" link in post list when RTC lock expires#11346shekharnwagh wants to merge 4 commits intoWordPress:trunkfrom
Conversation
|
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. |
d2b21eb to
b26b107
Compare
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.
b26b107 to
00351ba
Compare
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-editingclass the heartbeat already manages. Also replacesaria-labelwithscreen-reader-textspans 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