Merge pull request #2255 from zed-industries/sort-collaborators-alphabetical

Sort collaborators in titlebar alphabetically instead of by replica id
This commit is contained in:
Julia 2023-03-08 21:54:29 -05:00 committed by GitHub
commit a3b1980a5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -572,15 +572,13 @@ impl CollabTitlebarItem {
room: &ModelHandle<Room>,
cx: &mut RenderContext<Self>,
) -> Vec<ElementBox> {
let project = workspace.read(cx).project().read(cx);
let mut participants = room
.read(cx)
.remote_participants()
.values()
.cloned()
.collect::<Vec<_>>();
participants.sort_by_key(|p| Some(project.collaborators().get(&p.peer_id)?.replica_id));
participants.sort_by_cached_key(|p| p.user.github_login.clone());
participants
.into_iter()