From 1f0a9ce418c822115cc0f0f0439d033b2073b0fd Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 11 Oct 2022 10:17:20 -0700 Subject: [PATCH 1/3] Proceed with share while project state uploads Co-authored-by: Antonio Scandurra --- crates/call/src/room.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs index 572f512d1c..5003479214 100644 --- a/crates/call/src/room.rs +++ b/crates/call/src/room.rs @@ -398,11 +398,11 @@ impl Room { cx.spawn(|this, mut cx| async move { let response = request.await?; - project - .update(&mut cx, |project, cx| { - project.shared(response.project_id, cx) - }) - .await?; + project.update(&mut cx, |project, cx| { + project + .shared(response.project_id, cx) + .detach_and_log_err(cx) + }); // If the user's location is in this project, it changes from UnsharedProject to SharedProject. this.update(&mut cx, |this, cx| { From 0e695eaae864797710821f909a6be5051d97ad6e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 11 Oct 2022 12:15:54 -0700 Subject: [PATCH 2/3] Wait for project sharing to complete in LSP status integration test --- crates/collab/src/integration_tests.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/collab/src/integration_tests.rs b/crates/collab/src/integration_tests.rs index bdd240fda8..6e08e7bef5 100644 --- a/crates/collab/src/integration_tests.rs +++ b/crates/collab/src/integration_tests.rs @@ -3874,6 +3874,7 @@ async fn test_language_server_statuses( .update(cx_a, |call, cx| call.share_project(project_a.clone(), cx)) .await .unwrap(); + deterministic.run_until_parked(); let project_b = client_b.build_remote_project(project_id, cx_b).await; project_b.read_with(cx_b, |project, _| { let status = project.language_server_statuses().next().unwrap(); From 65b8c512fed0d21ae55e35b02208a11dc2144018 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 11 Oct 2022 12:37:00 -0700 Subject: [PATCH 3/3] Allow opening other local projects via contacts list --- crates/collab_ui/src/contact_list.rs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/crates/collab_ui/src/contact_list.rs b/crates/collab_ui/src/contact_list.rs index 7b773240cf..c04f0fe72d 100644 --- a/crates/collab_ui/src/contact_list.rs +++ b/crates/collab_ui/src/contact_list.rs @@ -65,7 +65,6 @@ enum ContactEntry { project_id: u64, worktree_root_names: Vec, host_user_id: u64, - is_host: bool, is_last: bool, }, IncomingRequest(Arc), @@ -181,6 +180,7 @@ impl ContactList { let list_state = ListState::new(0, Orientation::Top, 1000., cx, move |this, ix, cx| { let theme = cx.global::().theme.clone(); let is_selected = this.selection == Some(ix); + let current_project_id = this.project.read(cx).remote_id(); match &this.entries[ix] { ContactEntry::Header(section) => { @@ -205,13 +205,12 @@ impl ContactList { project_id, worktree_root_names, host_user_id, - is_host, is_last, } => Self::render_participant_project( *project_id, worktree_root_names, *host_user_id, - *is_host, + Some(*project_id) == current_project_id, *is_last, is_selected, &theme.contact_list, @@ -341,15 +340,12 @@ impl ContactList { ContactEntry::ParticipantProject { project_id, host_user_id, - is_host, .. } => { - if !is_host { - cx.dispatch_global_action(JoinProject { - project_id: *project_id, - follow_user_id: *host_user_id, - }); - } + cx.dispatch_global_action(JoinProject { + project_id: *project_id, + follow_user_id: *host_user_id, + }); } _ => {} } @@ -407,7 +403,6 @@ impl ContactList { project_id: project.id, worktree_root_names: project.worktree_root_names.clone(), host_user_id: user_id, - is_host: true, is_last: projects.peek().is_none(), }); } @@ -448,7 +443,6 @@ impl ContactList { project_id: project.id, worktree_root_names: project.worktree_root_names.clone(), host_user_id: participant.user.id, - is_host: false, is_last: projects.peek().is_none(), }); } @@ -667,7 +661,7 @@ impl ContactList { project_id: u64, worktree_root_names: &[String], host_user_id: u64, - is_host: bool, + is_current: bool, is_last: bool, is_selected: bool, theme: &theme::ContactList, @@ -749,13 +743,13 @@ impl ContactList { .with_style(row.container) .boxed() }) - .with_cursor_style(if !is_host { + .with_cursor_style(if !is_current { CursorStyle::PointingHand } else { CursorStyle::Arrow }) .on_click(MouseButton::Left, move |_, cx| { - if !is_host { + if !is_current { cx.dispatch_global_action(JoinProject { project_id, follow_user_id: host_user_id,