Skip to content

Conversation

@maxschmeling
Copy link
Contributor

@maxschmeling maxschmeling commented Jan 29, 2026

What?

Adds the collaborators presence UI in the header.

Why?

When there are other connected collaborators in a real-time collaboration session, the current user needs to be able to know who else is in the post.

How?

Uses the useActiveUsers hook added in #75009 to populate data in a new <CollaboratorsPresence> component.

Testing Instructions

  1. Check out the PR
  2. Open an existing post or create a post and save
  3. Copy the URL and open in another tab
  4. See the collaborators list populated in the header

Testing Instructions for Keyboard

  1. When a collaborator is connected to a session you are in, click the collaborators button in the header
  2. The menu should open
  3. Press the escape key
  4. The menu should close

Screenshots or screencast

CleanShot 2026-01-29 at 14 30 30@2x

@github-actions github-actions bot added [Package] Core data /packages/core-data [Package] Editor /packages/editor [Package] Sync labels Jan 29, 2026
@maxschmeling maxschmeling marked this pull request as ready for review January 29, 2026 23:15
@maxschmeling maxschmeling requested a review from nerrad as a code owner January 29, 2026 23:15
@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Core data, [Package] Editor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@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: maxschmeling <[email protected]>

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

@ingeniumed ingeniumed added [Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Type] Experimental Experimental feature or API. labels Jan 29, 2026
@ingeniumed ingeniumed changed the title [Real-time Collaboration] Add collaborators presence UI Real-time Collaboration: Add collaborators presence UI Jan 29, 2026
Copy link
Contributor

@ingeniumed ingeniumed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work getting this in place. Most of my comments are about code cleanup and comments, but I do have one concern that needs to be tested to make sure it's not a problem.

);

if ( otherActiveUsers.length === 0 ) {
// Hide avatars when there are no other users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth noting that this ensures that this isn't useable outside the plugin, because RTC would be effectively disabled.

@@ -0,0 +1,88 @@
// import { speak } from '@wordpress/a11y';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed since the cursor registry isn't in place yet.

className="editor-collaborators-presence__list-item"
onClick={ () => {} }
disabled={ ! userState.isConnected }
aria-label="Clicking scrolls to cursor position in the editor"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label isn't true since the cursor registry isn't in place yet.


interface CollaboratorsListProps {
activeUsers: {
clientId: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't the existing type from core-data be potentially used here instead of having this be redefined? We do have access to core-data.

/**
* Renders a list showing all active collaborators with their details.
* Note: activeUsers should already exclude the current user (filtered by parent component).
* @param root0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would expand the docs here rather than just leaving them empty.

const isLargeViewport = useViewportMatch( 'medium' );
const isTooNarrowForDocumentBar = useMediaQuery( '(max-width: 403px)' );
const {
postId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the postType, it looks like there are a lot of possible post types here. We are interested in mainly the postType for posts. We do handle if the awareness instance isn't found, and perhaps the active users would be empty for cases where the post type isn't post. What happens if this is triggered for cases where the post type isn't post? Is there any error or does it work as expected?

This looks like it might have more side effects, and I'm not sure what that'd look like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Real-time Collaboration Phase 3 of the Gutenberg roadmap around real-time collaboration [Package] Core data /packages/core-data [Package] Editor /packages/editor [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants