Load assistant panel

Antonio Scandurra created

Change summary

crates/workspace2/src/status_bar.rs | 23 +++++-------------
crates/zed2/src/zed2.rs             | 37 +++++++++++++++---------------
2 files changed, 26 insertions(+), 34 deletions(-)

Detailed changes

crates/workspace2/src/status_bar.rs 🔗

@@ -62,22 +62,13 @@ impl Render for StatusBar {
                     )
                     .child(
                         // Right Dock
-                        h_stack()
-                            .gap_1()
-                            .child(
-                                // Terminal
-                                div()
-                                    .border()
-                                    .border_color(gpui::red())
-                                    .child(IconButton::new("status-assistant", Icon::Ai)),
-                            )
-                            .child(
-                                // Terminal
-                                div()
-                                    .border()
-                                    .border_color(gpui::red())
-                                    .child(IconButton::new("status-chat", Icon::MessageBubbles)),
-                            ),
+                        h_stack().gap_1().child(
+                            // Terminal
+                            div()
+                                .border()
+                                .border_color(gpui::red())
+                                .child(IconButton::new("status-chat", Icon::MessageBubbles)),
+                        ),
                     )
                     .child(self.render_right_tools(cx)),
             )

crates/zed2/src/zed2.rs 🔗

@@ -7,6 +7,7 @@ mod only_instance;
 mod open_listener;
 
 pub use assets::*;
+use assistant::AssistantPanel;
 use breadcrumbs::Breadcrumbs;
 use collections::VecDeque;
 use editor::{Editor, MultiBuffer};
@@ -177,7 +178,7 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
         cx.spawn(|workspace_handle, mut cx| async move {
             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 assistant_panel = AssistantPanel::load(workspace_handle.clone(), cx.clone());
             let channels_panel =
                 collab_ui::collab_panel::CollabPanel::load(workspace_handle.clone(), cx.clone());
             // let chat_panel =
@@ -189,14 +190,14 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
             let (
                 project_panel,
                 terminal_panel,
-                //     assistant_panel,
+                assistant_panel,
                 channels_panel,
                 //     chat_panel,
                 //     notification_panel,
             ) = futures::try_join!(
                 project_panel,
                 terminal_panel,
-                //     assistant_panel,
+                assistant_panel,
                 channels_panel,
                 //     chat_panel,
                 //     notification_panel,
@@ -206,25 +207,25 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
                 let project_panel_position = project_panel.position(cx);
                 workspace.add_panel(project_panel, cx);
                 workspace.add_panel(terminal_panel, cx);
-                //     workspace.add_panel(assistant_panel, cx);
+                workspace.add_panel(assistant_panel, cx);
                 workspace.add_panel(channels_panel, cx);
                 //     workspace.add_panel(chat_panel, cx);
                 //     workspace.add_panel(notification_panel, cx);
 
-                //     if !was_deserialized
-                //         && workspace
-                //             .project()
-                //             .read(cx)
-                //             .visible_worktrees(cx)
-                //             .any(|tree| {
-                //                 tree.read(cx)
-                //                     .root_entry()
-                //                     .map_or(false, |entry| entry.is_dir())
-                //             })
-                //     {
-                // workspace.toggle_dock(project_panel_position, cx);
-                //     }
-                // cx.focus_self();
+                // if !was_deserialized
+                //     && workspace
+                //         .project()
+                //         .read(cx)
+                //         .visible_worktrees(cx)
+                //         .any(|tree| {
+                //             tree.read(cx)
+                //                 .root_entry()
+                //                 .map_or(false, |entry| entry.is_dir())
+                //         })
+                // {
+                //     workspace.toggle_dock(project_panel_position, cx);
+                // }
+                cx.focus_self();
             })
         })
         .detach();