Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Initialize toggle chat panel action
Max Brunsfelde4bc3467239f
diff --git a/crates/collab_ui2/src/chat_panel.rs b/crates/collab_ui2/src/chat_panel.rsindex 7e460da8a5c..a6736d19f26 100644--- a/crates/collab_ui2/src/chat_panel.rs+++ b/crates/collab_ui2/src/chat_panel.rs@@ -36,6 +36,15 @@ mod message_editor;const MESSAGE_LOADING_THRESHOLD: usize = 50;const CHAT_PANEL_KEY: &'static str = "ChatPanel";+pub fn init(cx: &mut AppContext) {+ cx.observe_new_views(|workspace: &mut Workspace, _| {+ workspace.register_action(|workspace, _: &ToggleFocus, cx| {+ workspace.toggle_panel_focus::<ChatPanel>(cx);+ });+ })+ .detach();+}+pub struct ChatPanel {client: Arc<Client>,channel_store: Model<ChannelStore>,@@ -259,12 +268,10 @@ impl ChatPanel {.justify_between().z_index(1).bg(cx.theme().colors().background)- .border()- .border_color(gpui::red()).child(Label::new(self.active_chat.as_ref()- .and_then(|c| Some(c.0.read(cx).channel(cx)?.name.clone()))+ .and_then(|c| Some(format!("#{}", c.0.read(cx).channel(cx)?.name))).unwrap_or_default(),)).child(diff --git a/crates/collab_ui2/src/collab_ui.rs b/crates/collab_ui2/src/collab_ui.rsindex 3f571c13eed..9e01630b46d 100644--- a/crates/collab_ui2/src/collab_ui.rs+++ b/crates/collab_ui2/src/collab_ui.rs@@ -35,7 +35,7 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {collab_titlebar_item::init(cx);collab_panel::init(cx);channel_view::init(cx);- // chat_panel::init(cx);+ chat_panel::init(cx);notifications::init(&app_state, cx);// cx.add_global_action(toggle_screen_sharing);