Show cursors for remote participants (#4082)

This PR enables cursors for remote participants.

They are shown for 2 seconds when you focus a buffer, and then on hover.

Release Notes:

- Added usernames next to remote cursors
This commit is contained in:
Conrad Irwin 2024-01-18 20:58:09 -07:00 committed by GitHub
commit d76bd100f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 209 additions and 7 deletions

View file

@ -442,4 +442,13 @@ impl CollaborationHub for ChannelBufferCollaborationHub {
) -> &'a HashMap<u64, ParticipantIndex> {
self.0.read(cx).user_store().read(cx).participant_indices()
}
fn user_names(&self, cx: &AppContext) -> HashMap<u64, SharedString> {
let user_ids = self.collaborators(cx).values().map(|c| c.user_id);
self.0
.read(cx)
.user_store()
.read(cx)
.participant_names(user_ids, cx)
}
}