From 5a9f82583bdaf9a41676b23cf2d00d878beb4b09 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 10 Apr 2026 10:15:28 -0400 Subject: [PATCH] collab_ui: Disable Collab panel based on organization configuration (#53567) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR makes it so the Collab panel can be disabled by the organization's configuration: Screenshot 2026-04-09 at 2 38 35 PM Depends on https://github.com/zed-industries/cloud/pull/2247. Closes CLO-638. Release Notes: - N/A --- crates/cloud_api_types/src/cloud_api_types.rs | 1 + crates/collab_ui/src/collab_panel.rs | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/cloud_api_types/src/cloud_api_types.rs b/crates/cloud_api_types/src/cloud_api_types.rs index b4435f5bf0d53d6df3df54ef28bd99124b622421..439ed5b2e822382aebcc7dfc18f5887d7a389038 100644 --- a/crates/cloud_api_types/src/cloud_api_types.rs +++ b/crates/cloud_api_types/src/cloud_api_types.rs @@ -56,6 +56,7 @@ pub struct Organization { pub struct OrganizationConfiguration { pub is_zed_model_provider_enabled: bool, pub is_agent_thread_feedback_enabled: bool, + pub is_collaboration_enabled: bool, pub edit_prediction: OrganizationEditPredictionConfiguration, } diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index c17cdc3d6e529a311c308aa4f13cd4acd66dd84b..a80d5682eb56526d9060fd1014d29f1deac4d7d2 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -2620,6 +2620,18 @@ impl CollabPanel { cx.write_to_clipboard(item) } + fn render_disabled_by_organization(&mut self, _cx: &mut Context) -> Div { + v_flex() + .p_4() + .gap_4() + .size_full() + .text_center() + .justify_center() + .child(Label::new( + "Collaboration is disabled for this organization.", + )) + } + fn render_signed_out(&mut self, cx: &mut Context) -> Div { let collab_blurb = "Work with your team in realtime with collaborative editing, voice, shared notes and more."; @@ -3645,6 +3657,12 @@ impl Render for CollabPanel { fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { let status = *self.client.status().borrow(); + let is_collaboration_disabled = self + .user_store + .read(cx) + .current_organization_configuration() + .is_some_and(|config| !config.is_collaboration_enabled); + v_flex() .key_context(self.dispatch_context(window, cx)) .on_action(cx.listener(CollabPanel::cancel)) @@ -3664,7 +3682,9 @@ impl Render for CollabPanel { .on_action(cx.listener(CollabPanel::move_channel_down)) .track_focus(&self.focus_handle) .size_full() - .child(if !status.is_or_was_connected() || status.is_signing_in() { + .child(if is_collaboration_disabled { + self.render_disabled_by_organization(cx) + } else if !status.is_or_was_connected() || status.is_signing_in() { self.render_signed_out(cx) } else { self.render_signed_in(window, cx)