diff --git a/Cargo.lock b/Cargo.lock index 64202ed1c7a25ea63a4908cd86f57a0c6b76ed52..655ec8ab03ffe91673300d87dd2d4b00c315bfb8 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 fbdfb34386acb9702a7841de5beb50630ae52550..aa2cdb86283f8156fcf0f7213b0307949d427611 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 f9da9e5b7a70cd75f27f52246736dd4722c28406..00f37fddeed84184f160f5ffeac472df558a2b14 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 0000000000000000000000000000000000000000..312c7478e2f7b213656d6ee6bc2eb2b80633df6e --- /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 26c1194d748ae491c2606cedae4b42403b57bace..624030fe462a1c1b6af25cae7c1bcea15339a1e8 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 82629705a169c8ec3c0bcb8dfa68b01aa7b4ab5a..667e3d79847b5a29f134707ee9aeba148080f945 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 99983c4d6dc2def796ac4d498f1ba25aeb8d9f91..6233f0a0371f4aba6886aaa584117d335850acb3 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 bd6f28a4024e561d31ef6a0a690a67b80a0d1a76..a4cc8da6334d628f3c94e9da635a7efdf71c2b2f 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};