diff --git a/Cargo.lock b/Cargo.lock index e0a4b6a7bf..617d2c9a81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1254,31 +1254,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "channels" -version = "0.1.0" -dependencies = [ - "anyhow", - "client", - "collections", - "context_menu", - "db", - "editor", - "futures 0.3.28", - "gpui", - "log", - "menu", - "project", - "schemars", - "serde", - "serde_derive", - "serde_json", - "settings", - "theme", - "util", - "workspace", -] - [[package]] name = "chrono" version = "0.4.26" @@ -1577,6 +1552,7 @@ dependencies = [ "clock", "collections", "context_menu", + "db", "editor", "feedback", "futures 0.3.28", @@ -1588,6 +1564,7 @@ dependencies = [ "postage", "project", "recent_projects", + "schemars", "serde", "serde_derive", "settings", @@ -9882,7 +9859,6 @@ dependencies = [ "backtrace", "breadcrumbs", "call", - "channels", "chrono", "cli", "client", diff --git a/Cargo.toml b/Cargo.toml index 8803d1c34b..6e79c6b657 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ members = [ "crates/auto_update", "crates/breadcrumbs", "crates/call", - "crates/channels", "crates/cli", "crates/client", "crates/clock", diff --git a/assets/keymaps/default.json b/assets/keymaps/default.json index adc55f8c91..5c14d818a7 100644 --- a/assets/keymaps/default.json +++ b/assets/keymaps/default.json @@ -499,7 +499,8 @@ { "bindings": { "ctrl-alt-cmd-f": "workspace::FollowNextCollaborator", - "cmd-shift-c": "collab::ToggleContactsMenu", + // TODO: Move this to a dock open action + "cmd-shift-c": "collab_panel::ToggleFocus", "cmd-alt-i": "zed::DebugElements" } }, diff --git a/crates/channels/Cargo.toml b/crates/channels/Cargo.toml deleted file mode 100644 index 7507072130..0000000000 --- a/crates/channels/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "channels" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -path = "src/channels.rs" -doctest = false - -[dependencies] -collections = { path = "../collections" } -context_menu = { path = "../context_menu" } -client = { path = "../client" } -db = { path = "../db" } -editor = { path = "../editor" } -gpui = { path = "../gpui" } -project = { path = "../project" } -theme = { path = "../theme" } -settings = { path = "../settings" } -workspace = { path = "../workspace" } -menu = { path = "../menu" } -util = { path = "../util" } - -log.workspace = true -anyhow.workspace = true -schemars.workspace = true -serde_json.workspace = true -serde.workspace = true -serde_derive.workspace = true -futures.workspace = true - -[dev-dependencies] -client = { path = "../client", features = ["test-support"] } -editor = { path = "../editor", features = ["test-support"] } -gpui = { path = "../gpui", features = ["test-support"] } -workspace = { path = "../workspace", features = ["test-support"] } -serde_json.workspace = true diff --git a/crates/channels/src/channels.rs b/crates/channels/src/channels.rs deleted file mode 100644 index 7560a36015..0000000000 --- a/crates/channels/src/channels.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod channels_panel; -mod channels_panel_settings; - -pub use channels_panel::*; -use gpui::{AppContext}; - -use std::sync::Arc; - -use client::Client; - -pub fn init(client: Arc, cx: &mut AppContext) { - channels_panel::init(cx); -} diff --git a/crates/collab_ui/Cargo.toml b/crates/collab_ui/Cargo.toml index 4a38c2691c..2ceac649ec 100644 --- a/crates/collab_ui/Cargo.toml +++ b/crates/collab_ui/Cargo.toml @@ -23,6 +23,7 @@ test-support = [ [dependencies] auto_update = { path = "../auto_update" } +db = { path = "../db" } call = { path = "../call" } client = { path = "../client" } clock = { path = "../clock" } @@ -48,6 +49,7 @@ zed-actions = {path = "../zed-actions"} anyhow.workspace = true futures.workspace = true log.workspace = true +schemars.workspace = true postage.workspace = true serde.workspace = true serde_derive.workspace = true diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index a54c0e9e79..0d273fd1b8 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -1,12 +1,11 @@ use crate::{ - contact_notification::ContactNotification, contacts_popover, face_pile::FacePile, + contact_notification::ContactNotification, face_pile::FacePile, toggle_deafen, toggle_mute, toggle_screen_sharing, LeaveCall, ToggleDeafen, ToggleMute, ToggleScreenSharing, }; use call::{ActiveCall, ParticipantLocation, Room}; use client::{proto::PeerId, Client, ContactEventKind, SignIn, SignOut, User, UserStore}; use clock::ReplicaId; -use contacts_popover::ContactsPopover; use context_menu::{ContextMenu, ContextMenuItem}; use gpui::{ actions, @@ -33,7 +32,6 @@ const MAX_BRANCH_NAME_LENGTH: usize = 40; actions!( collab, [ - ToggleContactsMenu, ToggleUserMenu, ToggleProjectMenu, SwitchBranch, @@ -43,7 +41,6 @@ actions!( ); pub fn init(cx: &mut AppContext) { - cx.add_action(CollabTitlebarItem::toggle_contacts_popover); cx.add_action(CollabTitlebarItem::share_project); cx.add_action(CollabTitlebarItem::unshare_project); cx.add_action(CollabTitlebarItem::toggle_user_menu); @@ -56,7 +53,6 @@ pub struct CollabTitlebarItem { user_store: ModelHandle, client: Arc, workspace: WeakViewHandle, - contacts_popover: Option>, branch_popover: Option>, project_popover: Option>, user_menu: ViewHandle, @@ -109,7 +105,6 @@ impl View for CollabTitlebarItem { let status = workspace.read(cx).client().status(); let status = &*status.borrow(); if matches!(status, client::Status::Connected { .. }) { - right_container.add_child(self.render_toggle_contacts_button(&theme, cx)); let avatar = user.as_ref().and_then(|user| user.avatar.clone()); right_container.add_child(self.render_user_menu_button(&theme, avatar, cx)); } else { @@ -184,7 +179,6 @@ impl CollabTitlebarItem { project, user_store, client, - contacts_popover: None, user_menu: cx.add_view(|cx| { let view_id = cx.view_id(); let mut menu = ContextMenu::new(view_id, cx); @@ -315,9 +309,6 @@ impl CollabTitlebarItem { } fn active_call_changed(&mut self, cx: &mut ViewContext) { - if ActiveCall::global(cx).read(cx).room().is_none() { - self.contacts_popover = None; - } cx.notify(); } @@ -337,32 +328,6 @@ impl CollabTitlebarItem { .log_err(); } - pub fn toggle_contacts_popover(&mut self, _: &ToggleContactsMenu, cx: &mut ViewContext) { - if self.contacts_popover.take().is_none() { - let view = cx.add_view(|cx| { - ContactsPopover::new( - self.project.clone(), - self.user_store.clone(), - self.workspace.clone(), - cx, - ) - }); - cx.subscribe(&view, |this, _, event, cx| { - match event { - contacts_popover::Event::Dismissed => { - this.contacts_popover = None; - } - } - - cx.notify(); - }) - .detach(); - self.contacts_popover = Some(view); - } - - cx.notify(); - } - pub fn toggle_user_menu(&mut self, _: &ToggleUserMenu, cx: &mut ViewContext) { self.user_menu.update(cx, |user_menu, cx| { let items = if let Some(_) = self.user_store.read(cx).current_user() { @@ -519,79 +484,7 @@ impl CollabTitlebarItem { } cx.notify(); } - fn render_toggle_contacts_button( - &self, - theme: &Theme, - cx: &mut ViewContext, - ) -> AnyElement { - let titlebar = &theme.titlebar; - let badge = if self - .user_store - .read(cx) - .incoming_contact_requests() - .is_empty() - { - None - } else { - Some( - Empty::new() - .collapsed() - .contained() - .with_style(titlebar.toggle_contacts_badge) - .contained() - .with_margin_left( - titlebar - .toggle_contacts_button - .inactive_state() - .default - .icon_width, - ) - .with_margin_top( - titlebar - .toggle_contacts_button - .inactive_state() - .default - .icon_width, - ) - .aligned(), - ) - }; - - Stack::new() - .with_child( - MouseEventHandler::::new(0, cx, |state, _| { - let style = titlebar - .toggle_contacts_button - .in_state(self.contacts_popover.is_some()) - .style_for(state); - Svg::new("icons/radix/person.svg") - .with_color(style.color) - .constrained() - .with_width(style.icon_width) - .aligned() - .constrained() - .with_width(style.button_width) - .with_height(style.button_width) - .contained() - .with_style(style.container) - }) - .with_cursor_style(CursorStyle::PointingHand) - .on_click(MouseButton::Left, move |_, this, cx| { - this.toggle_contacts_popover(&Default::default(), cx) - }) - .with_tooltip::( - 0, - "Show contacts menu".into(), - Some(Box::new(ToggleContactsMenu)), - theme.tooltip.clone(), - cx, - ), - ) - .with_children(badge) - .with_children(self.render_contacts_popover_host(titlebar, cx)) - .into_any() - } fn render_toggle_screen_sharing_button( &self, theme: &Theme, @@ -923,23 +816,6 @@ impl CollabTitlebarItem { .into_any() } - fn render_contacts_popover_host<'a>( - &'a self, - _theme: &'a theme::Titlebar, - cx: &'a ViewContext, - ) -> Option> { - self.contacts_popover.as_ref().map(|popover| { - Overlay::new(ChildView::new(popover, cx)) - .with_fit_mode(OverlayFitMode::SwitchAnchor) - .with_anchor_corner(AnchorCorner::TopLeft) - .with_z_index(999) - .aligned() - .bottom() - .right() - .into_any() - }) - } - fn render_collaborators( &self, workspace: &ViewHandle, diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rs index df4b502391..edbb89e339 100644 --- a/crates/collab_ui/src/collab_ui.rs +++ b/crates/collab_ui/src/collab_ui.rs @@ -1,16 +1,14 @@ mod collab_titlebar_item; -mod contact_finder; -mod contact_list; mod contact_notification; -mod contacts_popover; mod face_pile; mod incoming_call_notification; mod notifications; mod project_shared_notification; mod sharing_status_indicator; +pub mod panel; use call::{ActiveCall, Room}; -pub use collab_titlebar_item::{CollabTitlebarItem, ToggleContactsMenu}; +pub use collab_titlebar_item::CollabTitlebarItem; use gpui::{actions, AppContext, Task}; use std::sync::Arc; use util::ResultExt; @@ -24,9 +22,7 @@ actions!( pub fn init(app_state: &Arc, cx: &mut AppContext) { vcs_menu::init(cx); collab_titlebar_item::init(cx); - contact_list::init(cx); - contact_finder::init(cx); - contacts_popover::init(cx); + panel::init(app_state.client.clone(), cx); incoming_call_notification::init(&app_state, cx); project_shared_notification::init(&app_state, cx); sharing_status_indicator::init(cx); diff --git a/crates/channels/src/channels_panel.rs b/crates/collab_ui/src/panel.rs similarity index 79% rename from crates/channels/src/channels_panel.rs rename to crates/collab_ui/src/panel.rs index 063f652191..8fec29133f 100644 --- a/crates/channels/src/channels_panel.rs +++ b/crates/collab_ui/src/panel.rs @@ -1,15 +1,17 @@ +mod contacts; +mod panel_settings; + use std::sync::Arc; -use crate::channels_panel_settings::{ChannelsPanelDockPosition, ChannelsPanelSettings}; use anyhow::Result; -use collections::HashMap; +use client::Client; use context_menu::ContextMenu; use db::kvp::KEY_VALUE_STORE; use gpui::{ actions, elements::{ChildView, Flex, Label, ParentElement, Stack}, - serde_json, AppContext, AsyncAppContext, Element, Entity, Task, View, ViewContext, - ViewHandle, WeakViewHandle, + serde_json, AppContext, AsyncAppContext, Element, Entity, Task, View, ViewContext, ViewHandle, + WeakViewHandle, }; use project::Fs; use serde_derive::{Deserialize, Serialize}; @@ -20,27 +22,32 @@ use workspace::{ Workspace, }; -actions!(channels, [ToggleFocus]); +use self::{ + contacts::Contacts, + panel_settings::{ChannelsPanelDockPosition, ChannelsPanelSettings}, +}; + +actions!(collab_panel, [ToggleFocus]); const CHANNELS_PANEL_KEY: &'static str = "ChannelsPanel"; -pub fn init(cx: &mut AppContext) { - settings::register::(cx); +pub fn init(_client: Arc, cx: &mut AppContext) { + settings::register::(cx); + contacts::init(cx); } -pub struct ChannelsPanel { +pub struct CollabPanel { width: Option, fs: Arc, has_focus: bool, pending_serialization: Task>, context_menu: ViewHandle, - collapsed_channels: HashMap, + contacts: ViewHandle, } #[derive(Serialize, Deserialize)] struct SerializedChannelsPanel { width: Option, - collapsed_channels: Option>, } #[derive(Debug)] @@ -49,26 +56,34 @@ pub enum Event { Focus, } -impl Entity for ChannelsPanel { +impl Entity for CollabPanel { type Event = Event; } -impl ChannelsPanel { +impl CollabPanel { pub fn new(workspace: &mut Workspace, cx: &mut ViewContext) -> ViewHandle { cx.add_view(|cx| { let view_id = cx.view_id(); + let this = Self { width: None, has_focus: false, fs: workspace.app_state().fs.clone(), pending_serialization: Task::ready(None), context_menu: cx.add_view(|cx| ContextMenu::new(view_id, cx)), - collapsed_channels: HashMap::default(), + contacts: cx.add_view(|cx| { + Contacts::new( + workspace.project().clone(), + workspace.user_store().clone(), + workspace.weak_handle(), + cx, + ) + }), }; // Update the dock position when the setting changes. let mut old_dock_position = this.position(cx); - cx.observe_global::(move |this: &mut ChannelsPanel, cx| { + cx.observe_global::(move |this: &mut CollabPanel, cx| { let new_dock_position = this.position(cx); if new_dock_position != old_dock_position { old_dock_position = new_dock_position; @@ -99,12 +114,10 @@ impl ChannelsPanel { }; workspace.update(&mut cx, |workspace, cx| { - let panel = ChannelsPanel::new(workspace, cx); + let panel = CollabPanel::new(workspace, cx); if let Some(serialized_panel) = serialized_panel { panel.update(cx, |panel, cx| { panel.width = serialized_panel.width; - panel.collapsed_channels = - serialized_panel.collapsed_channels.unwrap_or_default(); cx.notify(); }); } @@ -115,16 +128,12 @@ impl ChannelsPanel { fn serialize(&mut self, cx: &mut ViewContext) { let width = self.width; - let collapsed_channels = self.collapsed_channels.clone(); self.pending_serialization = cx.background().spawn( async move { KEY_VALUE_STORE .write_kvp( CHANNELS_PANEL_KEY.into(), - serde_json::to_string(&SerializedChannelsPanel { - width, - collapsed_channels: Some(collapsed_channels), - })?, + serde_json::to_string(&SerializedChannelsPanel { width })?, ) .await?; anyhow::Ok(()) @@ -134,7 +143,7 @@ impl ChannelsPanel { } } -impl View for ChannelsPanel { +impl View for CollabPanel { fn ui_name() -> &'static str { "ChannelsPanel" } @@ -159,18 +168,19 @@ impl View for ChannelsPanel { // Full panel column Flex::column() .with_child( - Flex::column().with_child( - Flex::row().with_child( - Label::new( - "Contacts", - theme.editor.invalid_information_diagnostic.message.clone(), - ) - .into_any(), - ), - ), + Flex::column() + .with_child( + Flex::row().with_child( + Label::new( + "Contacts", + theme.editor.invalid_information_diagnostic.message.clone(), + ) + .into_any(), + ), + ) + .with_child(ChildView::new(&self.contacts, cx)), ) - .scrollable::(0, None, cx) - .expanded(), + .scrollable::(0, None, cx), ) .with_child(ChildView::new(&self.context_menu, cx)) .into_any_named("channels panel") @@ -178,7 +188,7 @@ impl View for ChannelsPanel { } } -impl Panel for ChannelsPanel { +impl Panel for CollabPanel { fn position(&self, cx: &gpui::WindowContext) -> DockPosition { match settings::get::(cx).dock { ChannelsPanelDockPosition::Left => DockPosition::Left, @@ -216,7 +226,7 @@ impl Panel for ChannelsPanel { } fn icon_path(&self) -> &'static str { - "icons/bolt_16.svg" + "icons/radix/person.svg" } fn icon_tooltip(&self) -> (String, Option>) { diff --git a/crates/collab_ui/src/contacts_popover.rs b/crates/collab_ui/src/panel/contacts.rs similarity index 85% rename from crates/collab_ui/src/contacts_popover.rs rename to crates/collab_ui/src/panel/contacts.rs index 1d6d1c84c7..a1c1061f5e 100644 --- a/crates/collab_ui/src/contacts_popover.rs +++ b/crates/collab_ui/src/panel/contacts.rs @@ -1,7 +1,6 @@ -use crate::{ - contact_finder::{build_contact_finder, ContactFinder}, - contact_list::ContactList, -}; +mod contact_finder; +mod contacts_list; + use client::UserStore; use gpui::{ actions, elements::*, platform::MouseButton, AppContext, Entity, ModelHandle, View, @@ -11,10 +10,14 @@ use picker::PickerEvent; use project::Project; use workspace::Workspace; +use self::{contacts_list::ContactList, contact_finder::{ContactFinder, build_contact_finder}}; + actions!(contacts_popover, [ToggleContactFinder]); pub fn init(cx: &mut AppContext) { - cx.add_action(ContactsPopover::toggle_contact_finder); + cx.add_action(Contacts::toggle_contact_finder); + contact_finder::init(cx); + contacts_list::init(cx); } pub enum Event { @@ -26,7 +29,7 @@ enum Child { ContactFinder(ViewHandle), } -pub struct ContactsPopover { +pub struct Contacts { child: Child, project: ModelHandle, user_store: ModelHandle, @@ -34,7 +37,7 @@ pub struct ContactsPopover { _subscription: Option, } -impl ContactsPopover { +impl Contacts { pub fn new( project: ModelHandle, user_store: ModelHandle, @@ -61,7 +64,7 @@ impl ContactsPopover { } } - fn show_contact_finder(&mut self, editor_text: String, cx: &mut ViewContext) { + fn show_contact_finder(&mut self, editor_text: String, cx: &mut ViewContext) { let child = cx.add_view(|cx| { let finder = build_contact_finder(self.user_store.clone(), cx); finder.set_query(editor_text, cx); @@ -75,7 +78,7 @@ impl ContactsPopover { cx.notify(); } - fn show_contact_list(&mut self, editor_text: String, cx: &mut ViewContext) { + fn show_contact_list(&mut self, editor_text: String, cx: &mut ViewContext) { let child = cx.add_view(|cx| { ContactList::new( self.project.clone(), @@ -87,8 +90,8 @@ impl ContactsPopover { }); cx.focus(&child); self._subscription = Some(cx.subscribe(&child, |this, _, event, cx| match event { - crate::contact_list::Event::Dismissed => cx.emit(Event::Dismissed), - crate::contact_list::Event::ToggleContactFinder => { + contacts_list::Event::Dismissed => cx.emit(Event::Dismissed), + contacts_list::Event::ToggleContactFinder => { this.toggle_contact_finder(&Default::default(), cx) } })); @@ -97,11 +100,11 @@ impl ContactsPopover { } } -impl Entity for ContactsPopover { +impl Entity for Contacts { type Event = Event; } -impl View for ContactsPopover { +impl View for Contacts { fn ui_name() -> &'static str { "ContactsPopover" } @@ -113,9 +116,9 @@ impl View for ContactsPopover { Child::ContactFinder(child) => ChildView::new(child, cx), }; - MouseEventHandler::::new(0, cx, |_, _| { + MouseEventHandler::::new(0, cx, |_, _| { Flex::column() - .with_child(child.flex(1., true)) + .with_child(child) .contained() .with_style(theme.contacts_popover.container) .constrained() diff --git a/crates/collab_ui/src/contact_finder.rs b/crates/collab_ui/src/panel/contacts/contact_finder.rs similarity index 100% rename from crates/collab_ui/src/contact_finder.rs rename to crates/collab_ui/src/panel/contacts/contact_finder.rs diff --git a/crates/collab_ui/src/contact_list.rs b/crates/collab_ui/src/panel/contacts/contacts_list.rs similarity index 99% rename from crates/collab_ui/src/contact_list.rs rename to crates/collab_ui/src/panel/contacts/contacts_list.rs index 428f2156d1..f37d64cd05 100644 --- a/crates/collab_ui/src/contact_list.rs +++ b/crates/collab_ui/src/panel/contacts/contacts_list.rs @@ -1326,12 +1326,11 @@ impl View for ContactList { Flex::column() .with_child( Flex::row() - .with_child( - ChildView::new(&self.filter_editor, cx) - .contained() - .with_style(theme.contact_list.user_query_editor.container) - .flex(1., true), - ) + // .with_child( + // ChildView::new(&self.filter_editor, cx) + // .contained() + // .with_style(theme.contact_list.user_query_editor.container) + // ) .with_child( MouseEventHandler::::new(0, cx, |_, _| { render_icon_button( @@ -1354,7 +1353,7 @@ impl View for ContactList { .constrained() .with_height(theme.contact_list.user_query_editor_height), ) - .with_child(List::new(self.list_state.clone()).flex(1., false)) + // .with_child(List::new(self.list_state.clone())) .into_any() } diff --git a/crates/channels/src/channels_panel_settings.rs b/crates/collab_ui/src/panel/panel_settings.rs similarity index 100% rename from crates/channels/src/channels_panel_settings.rs rename to crates/collab_ui/src/panel/panel_settings.rs diff --git a/crates/gpui/src/elements.rs b/crates/gpui/src/elements.rs index 78403444ff..746238aaa9 100644 --- a/crates/gpui/src/elements.rs +++ b/crates/gpui/src/elements.rs @@ -47,6 +47,10 @@ pub trait Element: 'static { type LayoutState; type PaintState; + fn view_name(&self) -> &'static str { + V::ui_name() + } + fn layout( &mut self, constraint: SizeConstraint, @@ -267,8 +271,8 @@ impl> AnyElementState for ElementState { | ElementState::PostLayout { mut element, .. } | ElementState::PostPaint { mut element, .. } => { let (size, layout) = element.layout(constraint, view, cx); - debug_assert!(size.x().is_finite()); - debug_assert!(size.y().is_finite()); + debug_assert!(size.x().is_finite(), "Element for {:?} had infinite x size after layout", element.view_name()); + debug_assert!(size.y().is_finite(), "Element for {:?} had infinite x size after layout", element.view_name()); result = size; ElementState::PostLayout { diff --git a/crates/rpc/src/proto.rs b/crates/rpc/src/proto.rs index 605b05a562..e24d6cb4b7 100644 --- a/crates/rpc/src/proto.rs +++ b/crates/rpc/src/proto.rs @@ -1,3 +1,5 @@ +#![allow(non_snake_case)] + use super::{entity_messages, messages, request_messages, ConnectionId, TypedEnvelope}; use anyhow::{anyhow, Result}; use async_tungstenite::tungstenite::Message as WebSocketMessage; diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 71d8461b01..a5877aaccb 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -21,7 +21,6 @@ activity_indicator = { path = "../activity_indicator" } auto_update = { path = "../auto_update" } breadcrumbs = { path = "../breadcrumbs" } call = { path = "../call" } -channels = { path = "../channels" } cli = { path = "../cli" } collab_ui = { path = "../collab_ui" } collections = { path = "../collections" } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 5739052b67..e44ab3e33a 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -155,7 +155,6 @@ fn main() { outline::init(cx); project_symbols::init(cx); project_panel::init(Assets, cx); - channels::init(client.clone(), cx); diagnostics::init(cx); search::init(cx); semantic_index::init(fs.clone(), http.clone(), languages.clone(), cx); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index c1046c0995..b2d1c2a7a2 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -9,9 +9,8 @@ use ai::AssistantPanel; use anyhow::Context; use assets::Assets; use breadcrumbs::Breadcrumbs; -use channels::ChannelsPanel; pub use client; -use collab_ui::{CollabTitlebarItem, ToggleContactsMenu}; +use collab_ui::CollabTitlebarItem; // TODO: Add back toggle collab ui shortcut use collections::VecDeque; pub use editor; use editor::{Editor, MultiBuffer}; @@ -86,20 +85,6 @@ pub fn init(app_state: &Arc, cx: &mut gpui::AppContext) { cx.toggle_full_screen(); }, ); - cx.add_action( - |workspace: &mut Workspace, _: &ToggleContactsMenu, cx: &mut ViewContext| { - if let Some(item) = workspace - .titlebar_item() - .and_then(|item| item.downcast::()) - { - cx.defer(move |_, cx| { - item.update(cx, |item, cx| { - item.toggle_contacts_popover(&Default::default(), cx); - }); - }); - } - }, - ); cx.add_global_action(quit); cx.add_global_action(move |action: &OpenBrowser, cx| cx.platform().open_url(&action.url)); cx.add_global_action(move |_: &IncreaseBufferFontSize, cx| { @@ -223,8 +208,10 @@ pub fn init(app_state: &Arc, cx: &mut gpui::AppContext) { }, ); cx.add_action( - |workspace: &mut Workspace, _: &channels::ToggleFocus, cx: &mut ViewContext| { - workspace.toggle_panel_focus::(cx); + |workspace: &mut Workspace, + _: &collab_ui::panel::ToggleFocus, + cx: &mut ViewContext| { + workspace.toggle_panel_focus::(cx); }, ); cx.add_action( @@ -345,7 +332,8 @@ pub fn initialize_workspace( let project_panel = ProjectPanel::load(workspace_handle.clone(), cx.clone()); let terminal_panel = TerminalPanel::load(workspace_handle.clone(), cx.clone()); let assistant_panel = AssistantPanel::load(workspace_handle.clone(), cx.clone()); - let channels_panel = ChannelsPanel::load(workspace_handle.clone(), cx.clone()); + let channels_panel = + collab_ui::panel::CollabPanel::load(workspace_handle.clone(), cx.clone()); let (project_panel, terminal_panel, assistant_panel, channels_panel) = futures::try_join!( project_panel, terminal_panel,