Move contacts panel features into collab_ui

This commit is contained in:
Antonio Scandurra 2022-10-06 14:00:14 +02:00
parent 7763acbdd5
commit 40163da679
17 changed files with 152 additions and 1134 deletions

View file

@ -112,7 +112,6 @@ fn main() {
go_to_line::init(cx);
file_finder::init(cx);
chat_panel::init(cx);
contacts_panel::init(cx);
outline::init(cx);
project_symbols::init(cx);
project_panel::init(cx);

View file

@ -244,10 +244,6 @@ pub fn menus() -> Vec<Menu<'static>> {
name: "Project Panel",
action: Box::new(project_panel::ToggleFocus),
},
MenuItem::Action {
name: "Contacts Panel",
action: Box::new(contacts_panel::ToggleFocus),
},
MenuItem::Action {
name: "Command Palette",
action: Box::new(command_palette::Toggle),

View file

@ -12,8 +12,6 @@ use breadcrumbs::Breadcrumbs;
pub use client;
use collab_ui::CollabTitlebarItem;
use collections::VecDeque;
pub use contacts_panel;
use contacts_panel::ContactsPanel;
pub use editor;
use editor::{Editor, MultiBuffer};
use gpui::{
@ -208,13 +206,6 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
workspace.toggle_sidebar_item_focus(SidebarSide::Left, 0, cx);
},
);
cx.add_action(
|workspace: &mut Workspace,
_: &contacts_panel::ToggleFocus,
cx: &mut ViewContext<Workspace>| {
workspace.toggle_sidebar_item_focus(SidebarSide::Right, 0, cx);
},
);
activity_indicator::init(cx);
call::init(app_state.client.clone(), app_state.user_store.clone(), cx);
@ -281,14 +272,11 @@ pub fn initialize_workspace(
}));
});
let collab_titlebar_item = cx.add_view(|cx| CollabTitlebarItem::new(&workspace_handle, cx));
let collab_titlebar_item =
cx.add_view(|cx| CollabTitlebarItem::new(&workspace_handle, &app_state.user_store, cx));
workspace.set_titlebar_item(collab_titlebar_item, cx);
let project_panel = ProjectPanel::new(workspace.project().clone(), cx);
let contact_panel = cx.add_view(|cx| {
ContactsPanel::new(app_state.user_store.clone(), workspace.weak_handle(), cx)
});
workspace.left_sidebar().update(cx, |sidebar, cx| {
sidebar.add_item(
"icons/folder_tree_16.svg",
@ -297,14 +285,6 @@ pub fn initialize_workspace(
cx,
)
});
workspace.right_sidebar().update(cx, |sidebar, cx| {
sidebar.add_item(
"icons/user_group_16.svg",
"Contacts Panel".to_string(),
contact_panel,
cx,
)
});
let diagnostic_summary =
cx.add_view(|cx| diagnostics::items::DiagnosticIndicator::new(workspace.project(), cx));