diff --git a/Cargo.lock b/Cargo.lock index 64202ed1c7..655ec8ab03 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1063,7 +1063,7 @@ dependencies = [ ] [[package]] -name = "collab_titlebar_item" +name = "collab_ui" version = "0.1.0" dependencies = [ "anyhow", @@ -7159,7 +7159,7 @@ dependencies = [ "cli", "client", "clock", - "collab_titlebar_item", + "collab_ui", "collections", "command_palette", "contacts_panel", diff --git a/crates/collab_titlebar_item/Cargo.toml b/crates/collab_ui/Cargo.toml similarity index 95% rename from crates/collab_titlebar_item/Cargo.toml rename to crates/collab_ui/Cargo.toml index fbdfb34386..aa2cdb8628 100644 --- a/crates/collab_titlebar_item/Cargo.toml +++ b/crates/collab_ui/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "collab_titlebar_item" +name = "collab_ui" version = "0.1.0" edition = "2021" [lib] -path = "src/collab_titlebar_item.rs" +path = "src/collab_ui.rs" doctest = false [features] diff --git a/crates/collab_titlebar_item/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs similarity index 99% rename from crates/collab_titlebar_item/src/collab_titlebar_item.rs rename to crates/collab_ui/src/collab_titlebar_item.rs index f9da9e5b7a..00f37fddee 100644 --- a/crates/collab_titlebar_item/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -1,5 +1,4 @@ -mod contacts_popover; - +use crate::contacts_popover; use client::{Authenticate, PeerId}; use clock::ReplicaId; use contacts_popover::ContactsPopover; @@ -20,7 +19,6 @@ use workspace::{FollowNextCollaborator, ToggleFollow, Workspace}; actions!(contacts_titlebar_item, [ToggleContactsPopover]); pub fn init(cx: &mut MutableAppContext) { - contacts_popover::init(cx); cx.add_action(CollabTitlebarItem::toggle_contacts_popover); } diff --git a/crates/collab_ui/src/collab_ui.rs b/crates/collab_ui/src/collab_ui.rs new file mode 100644 index 0000000000..312c7478e2 --- /dev/null +++ b/crates/collab_ui/src/collab_ui.rs @@ -0,0 +1,10 @@ +mod collab_titlebar_item; +mod contacts_popover; + +pub use collab_titlebar_item::CollabTitlebarItem; +use gpui::MutableAppContext; + +pub fn init(cx: &mut MutableAppContext) { + contacts_popover::init(cx); + collab_titlebar_item::init(cx); +} diff --git a/crates/collab_titlebar_item/src/contacts_popover.rs b/crates/collab_ui/src/contacts_popover.rs similarity index 99% rename from crates/collab_titlebar_item/src/contacts_popover.rs rename to crates/collab_ui/src/contacts_popover.rs index 26c1194d74..624030fe46 100644 --- a/crates/collab_titlebar_item/src/contacts_popover.rs +++ b/crates/collab_ui/src/contacts_popover.rs @@ -189,7 +189,7 @@ impl ContactsPopover { fn set_room(&mut self, room: Option>, cx: &mut ViewContext) { if let Some(room) = room { - let observation = cx.observe(&room, |this, room, cx| this.room_updated(room, cx)); + let observation = cx.observe(&room, |_, _, cx| cx.notify()); self.room = Some((room, observation)); } else { self.room = None; @@ -198,10 +198,6 @@ impl ContactsPopover { cx.notify(); } - fn room_updated(&mut self, room: ModelHandle, cx: &mut ViewContext) { - cx.notify(); - } - fn clear_filter(&mut self, _: &Cancel, cx: &mut ViewContext) { let did_clear = self.filter_editor.update(cx, |editor, cx| { if editor.buffer().read(cx).len(cx) > 0 { diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 82629705a1..667e3d7984 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -21,7 +21,7 @@ auto_update = { path = "../auto_update" } breadcrumbs = { path = "../breadcrumbs" } chat_panel = { path = "../chat_panel" } cli = { path = "../cli" } -collab_titlebar_item = { path = "../collab_titlebar_item" } +collab_ui = { path = "../collab_ui" } collections = { path = "../collections" } command_palette = { path = "../command_palette" } context_menu = { path = "../context_menu" } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 99983c4d6d..6233f0a037 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -107,7 +107,7 @@ fn main() { project::Project::init(&client); client::Channel::init(&client); client::init(client.clone(), cx); - collab_titlebar_item::init(cx); + collab_ui::init(cx); command_palette::init(cx); editor::init(cx); go_to_line::init(cx); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index bd6f28a402..a4cc8da633 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -10,7 +10,7 @@ use anyhow::{anyhow, Context, Result}; use assets::Assets; use breadcrumbs::Breadcrumbs; pub use client; -use collab_titlebar_item::CollabTitlebarItem; +use collab_ui::CollabTitlebarItem; use collections::VecDeque; pub use contacts_panel; use contacts_panel::ContactsPanel; @@ -21,11 +21,10 @@ use gpui::{ geometry::vector::vec2f, impl_actions, platform::{WindowBounds, WindowOptions}, - AssetSource, AsyncAppContext, ModelHandle, TitlebarOptions, ViewContext, WindowKind, + AssetSource, AsyncAppContext, TitlebarOptions, ViewContext, WindowKind, }; use language::Rope; pub use lsp; -use postage::watch; pub use project::{self, fs}; use project_panel::ProjectPanel; use search::{BufferSearchBar, ProjectSearchBar};