Skip to content

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

Merged
shekharnwagh merged 4 commits intoWordPress:trunkfrom
shekharnwagh:fix/rtc-post-list-action-link
Mar 27, 2026
Merged

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

Conversation

@shekharnwagh
Copy link
Copy Markdown
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 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-locked 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
Copy Markdown

github-actions bot commented Mar 25, 2026

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>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: chriszarate <czarate@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 shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from ae45fc9 to 042578f Compare March 25, 2026 16:43
shekharnwagh and others added 4 commits March 26, 2026 21: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.
The CSS was targeting .wp-collaborative-editing, a class only set
by core 7.0's inline-edit-post.js. The compat layer runs on older
versions where the heartbeat uses .wp-locked, so the toggle never
worked. Since this CSS is only output when RTC is enabled,
.wp-locked always means collaborative editing here.
@shekharnwagh shekharnwagh force-pushed the fix/rtc-post-list-action-link branch from 042578f to 5e02f02 Compare March 26, 2026 16:21
@shekharnwagh shekharnwagh merged commit 41bef30 into WordPress:trunk Mar 27, 2026
39 checks passed
@github-actions github-actions bot added this to the Gutenberg 22.9 milestone Mar 27, 2026
@shekharnwagh shekharnwagh deleted the fix/rtc-post-list-action-link branch March 27, 2026 17:17
@github-actions github-actions bot removed 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 27, 2026
gutenbergplugin pushed a commit that referenced this pull request Mar 27, 2026
* RTC: Fix stuck "Join" link in post list when lock expires

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.

* RTC: Fix checkbox not showing for locked posts in post list

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.

* RTC: Use sprintf with multi-line template for action link markup

* RTC: Target .wp-locked for Edit/Join toggle in compat layer

The CSS was targeting .wp-collaborative-editing, a class only set
by core 7.0's inline-edit-post.js. The compat layer runs on older
versions where the heartbeat uses .wp-locked, so the toggle never
worked. Since this CSS is only output when RTC is enabled,
.wp-locked always means collaborative editing here.

----

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
@github-actions github-actions bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Mar 27, 2026
@github-actions
Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 7ab515c

adamsilverstein pushed a commit that referenced this pull request Mar 31, 2026
* RTC: Fix stuck "Join" link in post list when lock expires

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.

* RTC: Fix checkbox not showing for locked posts in post list

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.

* RTC: Use sprintf with multi-line template for action link markup

* RTC: Target .wp-locked for Edit/Join toggle in compat layer

The CSS was targeting .wp-collaborative-editing, a class only set
by core 7.0's inline-edit-post.js. The compat layer runs on older
versions where the heartbeat uses .wp-locked, so the toggle never
worked. Since this CSS is only output when RTC is enabled,
.wp-locked always means collaborative editing here.

----

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
@oandregal oandregal added the [Type] Bug An existing feature does not function as intended label Apr 1, 2026
ObliviousHarmony pushed a commit that referenced this pull request Apr 1, 2026
* RTC: Fix stuck "Join" link in post list when lock expires

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.

* RTC: Fix checkbox not showing for locked posts in post list

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.

* RTC: Use sprintf with multi-line template for action link markup

* RTC: Target .wp-locked for Edit/Join toggle in compat layer

The CSS was targeting .wp-collaborative-editing, a class only set
by core 7.0's inline-edit-post.js. The compat layer runs on older
versions where the heartbeat uses .wp-locked, so the toggle never
worked. Since this CSS is only output when RTC is enabled,
.wp-locked always means collaborative editing here.

----

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
jorgefilipecosta added a commit to jorgefilipecosta/wordpress-develop that referenced this pull request Apr 6, 2026
Gutenberg changelog:

- Style Book: Fix missing styles for classic themes in stylebook route (WordPress/gutenberg#76843)
- RTC: Fix stuck "Join" link in post list when lock expires (WordPress/gutenberg#76795)
- Icon: Fix center alignment in the editor for classic themes (WordPress/gutenberg#76878)
- RTC: Fix notes not syncing between collaborative editors (WordPress/gutenberg#76873)
- Latest Comments: Fix v1 deprecated block missing supports (WordPress/gutenberg#76877)
- Connectors: Add Akismet as a default connector (WordPress/gutenberg#76828)
- Restore with compaction update (WordPress/gutenberg#76872)
- Improve JSDoc for abilities API (WordPress/gutenberg#76824)
- Connectors: Replace plugin.slug with plugin.file (WordPress/gutenberg#76909)
- Block visibility badge: use canvas iframe for viewport detection (WordPress/gutenberg#76889)
- Connectors: Update help text from 'reset' to 'manage' (WordPress/gutenberg#76963)
- Connectors: Hide Akismet unless already installed (WordPress/gutenberg#76962)
- Wrap sync update processing in try/catch (WordPress/gutenberg#76968)
- Backport: Improve validation and permission checks for `WP_HTTP_Polling_Sync_Server` (WordPress/gutenberg#76987)
- Connectors: account for mu-plugins when resolving plugin.file status (WordPress/gutenberg#76994)
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Apr 6, 2026
This updates the pinned hash from the `gutenberg` from `0d133bf7e7437d65d68a06551f3d613a7d8e4361` to `e2970ba736edb99e08fb369d4fb0c378189468ee`.
The following changes are included:

- WordPress/gutenberg#76478 Boot: Fix black area below content when sidebar is taller than page c… (WordPress/gutenberg#76764)
- Style Book: Fix missing styles for classic themes in stylebook route (WordPress/gutenberg#76843)
- RTC: Fix stuck "Join" link in post list when lock expires (WordPress/gutenberg#76795)
- Icon: Fix center alignment in the editor for classic themes (WordPress/gutenberg#76878)
- RTC: Fix notes not syncing between collaborative editors (WordPress/gutenberg#76873)
- Latest Comments: Fix v1 deprecated block missing supports (WordPress/gutenberg#76877)
- Connectors: Add Akismet as a default connector (WordPress/gutenberg#76828)
- Restore with compaction update (WordPress/gutenberg#76872)
- Improve JSDoc for abilities API (WordPress/gutenberg#76824)
- Connectors: Replace plugin.slug with plugin.file (WordPress/gutenberg#76909)
- Block visibility badge: use canvas iframe for viewport detection (WordPress/gutenberg#76889)
- Connectors: Update help text from 'reset' to 'manage' (WordPress/gutenberg#76963)
- Connectors: Hide Akismet unless already installed (WordPress/gutenberg#76962)
- Wrap sync update processing in try/catch (WordPress/gutenberg#76968)
- Backport: Improve validation and permission checks for `WP_HTTP_Polling_Sync_Server` (WordPress/gutenberg#76987)
- Connectors: account for mu-plugins when resolving plugin.file status (WordPress/gutenberg#76994)


A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/0d133bf7e7437d65d68a06551f3d613a7d8e4361…e2970ba736edb99e08fb369d4fb0c378189468ee.

Log created with:

git log --reverse --format="- %s" 0d133bf7e7437d65d68a06551f3d613a7d8e4361..e2970ba736edb99e08fb369d4fb0c378189468ee | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.

git-svn-id: https://develop.svn.wordpress.org/trunk@62209 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Apr 6, 2026
This updates the pinned hash from the `gutenberg` from `0d133bf7e7437d65d68a06551f3d613a7d8e4361` to `e2970ba736edb99e08fb369d4fb0c378189468ee`.
The following changes are included:

- WordPress/gutenberg#76478 Boot: Fix black area below content when sidebar is taller than page c… (WordPress/gutenberg#76764)
- Style Book: Fix missing styles for classic themes in stylebook route (WordPress/gutenberg#76843)
- RTC: Fix stuck "Join" link in post list when lock expires (WordPress/gutenberg#76795)
- Icon: Fix center alignment in the editor for classic themes (WordPress/gutenberg#76878)
- RTC: Fix notes not syncing between collaborative editors (WordPress/gutenberg#76873)
- Latest Comments: Fix v1 deprecated block missing supports (WordPress/gutenberg#76877)
- Connectors: Add Akismet as a default connector (WordPress/gutenberg#76828)
- Restore with compaction update (WordPress/gutenberg#76872)
- Improve JSDoc for abilities API (WordPress/gutenberg#76824)
- Connectors: Replace plugin.slug with plugin.file (WordPress/gutenberg#76909)
- Block visibility badge: use canvas iframe for viewport detection (WordPress/gutenberg#76889)
- Connectors: Update help text from 'reset' to 'manage' (WordPress/gutenberg#76963)
- Connectors: Hide Akismet unless already installed (WordPress/gutenberg#76962)
- Wrap sync update processing in try/catch (WordPress/gutenberg#76968)
- Backport: Improve validation and permission checks for `WP_HTTP_Polling_Sync_Server` (WordPress/gutenberg#76987)
- Connectors: account for mu-plugins when resolving plugin.file status (WordPress/gutenberg#76994)


A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/0d133bf7e7437d65d68a06551f3d613a7d8e4361…e2970ba736edb99e08fb369d4fb0c378189468ee.

Log created with:

git log --reverse --format="- %s" 0d133bf7e7437d65d68a06551f3d613a7d8e4361..e2970ba736edb99e08fb369d4fb0c378189468ee | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.
Built from https://develop.svn.wordpress.org/trunk@62209


git-svn-id: http://core.svn.wordpress.org/trunk@61489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Apr 6, 2026
This updates the pinned hash from the `gutenberg` from `0d133bf7e7437d65d68a06551f3d613a7d8e4361` to `e2970ba736edb99e08fb369d4fb0c378189468ee`.
The following changes are included:

- WordPress/gutenberg#76478 Boot: Fix black area below content when sidebar is taller than page c… (WordPress/gutenberg#76764)
- Style Book: Fix missing styles for classic themes in stylebook route (WordPress/gutenberg#76843)
- RTC: Fix stuck "Join" link in post list when lock expires (WordPress/gutenberg#76795)
- Icon: Fix center alignment in the editor for classic themes (WordPress/gutenberg#76878)
- RTC: Fix notes not syncing between collaborative editors (WordPress/gutenberg#76873)
- Latest Comments: Fix v1 deprecated block missing supports (WordPress/gutenberg#76877)
- Connectors: Add Akismet as a default connector (WordPress/gutenberg#76828)
- Restore with compaction update (WordPress/gutenberg#76872)
- Improve JSDoc for abilities API (WordPress/gutenberg#76824)
- Connectors: Replace plugin.slug with plugin.file (WordPress/gutenberg#76909)
- Block visibility badge: use canvas iframe for viewport detection (WordPress/gutenberg#76889)
- Connectors: Update help text from 'reset' to 'manage' (WordPress/gutenberg#76963)
- Connectors: Hide Akismet unless already installed (WordPress/gutenberg#76962)
- Wrap sync update processing in try/catch (WordPress/gutenberg#76968)
- Backport: Improve validation and permission checks for `WP_HTTP_Polling_Sync_Server` (WordPress/gutenberg#76987)
- Connectors: account for mu-plugins when resolving plugin.file status (WordPress/gutenberg#76994)


A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/0d133bf7e7437d65d68a06551f3d613a7d8e4361…e2970ba736edb99e08fb369d4fb0c378189468ee.

Log created with:

git log --reverse --format="- %s" 0d133bf7e7437d65d68a06551f3d613a7d8e4361..e2970ba736edb99e08fb369d4fb0c378189468ee | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.

git-svn-id: https://develop.svn.wordpress.org/branches/7.0@62212 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Apr 6, 2026
This updates the pinned hash from the `gutenberg` from `0d133bf7e7437d65d68a06551f3d613a7d8e4361` to `e2970ba736edb99e08fb369d4fb0c378189468ee`.
The following changes are included:

- WordPress/gutenberg#76478 Boot: Fix black area below content when sidebar is taller than page c… (WordPress/gutenberg#76764)
- Style Book: Fix missing styles for classic themes in stylebook route (WordPress/gutenberg#76843)
- RTC: Fix stuck "Join" link in post list when lock expires (WordPress/gutenberg#76795)
- Icon: Fix center alignment in the editor for classic themes (WordPress/gutenberg#76878)
- RTC: Fix notes not syncing between collaborative editors (WordPress/gutenberg#76873)
- Latest Comments: Fix v1 deprecated block missing supports (WordPress/gutenberg#76877)
- Connectors: Add Akismet as a default connector (WordPress/gutenberg#76828)
- Restore with compaction update (WordPress/gutenberg#76872)
- Improve JSDoc for abilities API (WordPress/gutenberg#76824)
- Connectors: Replace plugin.slug with plugin.file (WordPress/gutenberg#76909)
- Block visibility badge: use canvas iframe for viewport detection (WordPress/gutenberg#76889)
- Connectors: Update help text from 'reset' to 'manage' (WordPress/gutenberg#76963)
- Connectors: Hide Akismet unless already installed (WordPress/gutenberg#76962)
- Wrap sync update processing in try/catch (WordPress/gutenberg#76968)
- Backport: Improve validation and permission checks for `WP_HTTP_Polling_Sync_Server` (WordPress/gutenberg#76987)
- Connectors: account for mu-plugins when resolving plugin.file status (WordPress/gutenberg#76994)


A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/0d133bf7e7437d65d68a06551f3d613a7d8e4361…e2970ba736edb99e08fb369d4fb0c378189468ee.

Log created with:

git log --reverse --format="- %s" 0d133bf7e7437d65d68a06551f3d613a7d8e4361..e2970ba736edb99e08fb369d4fb0c378189468ee | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy

See #64595.
Built from https://develop.svn.wordpress.org/branches/7.0@62212


git-svn-id: http://core.svn.wordpress.org/branches/7.0@61492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
adamsilverstein pushed a commit that referenced this pull request Apr 7, 2026
* RTC: Fix stuck "Join" link in post list when lock expires

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.

* RTC: Fix checkbox not showing for locked posts in post list

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.

* RTC: Use sprintf with multi-line template for action link markup

* RTC: Target .wp-locked for Edit/Join toggle in compat layer

The CSS was targeting .wp-collaborative-editing, a class only set
by core 7.0's inline-edit-post.js. The compat layer runs on older
versions where the heartbeat uses .wp-locked, so the toggle never
worked. Since this CSS is only output when RTC is enabled,
.wp-locked always means collaborative editing here.

----

Co-authored-by: shekharnwagh <shekharnwagh@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: chriszarate <czarate@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants