Replace dock shell with titlebar repository tabs
- Move repository navigation from the dock sidebar to titlebar tabs. - Route main and detail panels through Workspace. - Move sign-in into the main panel and remove unlinked navigation.
This commit is contained in:
@@ -11,7 +11,6 @@ use gpui_native_kit::dialog::Dialog;
|
||||
use gpui_native_kit::field::Field;
|
||||
use gpui_native_kit::icons::{Icon, IconRole};
|
||||
use gpui_native_kit::input::{Input, InputState};
|
||||
use gpui_native_kit::layout::dock::DockState;
|
||||
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
|
||||
use gpui_native_kit::tooltip::Tooltip;
|
||||
use settings::SettingsStore;
|
||||
@@ -21,6 +20,7 @@ use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_gra
|
||||
use crate::repo::actions::open_repo_panel;
|
||||
use crate::shared::dialogs::{close_global, open_global};
|
||||
use crate::shared::progress::{DialogProgress, error_row, push_steps_row};
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
/// Progress of the create-repository flow, so async results can be rendered.
|
||||
pub struct CreateRepoDialog {
|
||||
@@ -30,11 +30,15 @@ pub struct CreateRepoDialog {
|
||||
relay_input: Entity<InputState>,
|
||||
state: Entity<DialogProgress>,
|
||||
grasp_state: Entity<GraspServersState>,
|
||||
dock: WeakEntity<DockState>,
|
||||
workspace: WeakEntity<Workspace>,
|
||||
}
|
||||
|
||||
impl CreateRepoDialog {
|
||||
pub fn new(dock: WeakEntity<DockState>, window: &mut Window, cx: &mut App) -> Entity<Self> {
|
||||
pub fn new(
|
||||
workspace: WeakEntity<Workspace>,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) -> Entity<Self> {
|
||||
let settings = SettingsStore::global(cx);
|
||||
let default_folder = settings
|
||||
.read(cx)
|
||||
@@ -65,7 +69,7 @@ impl CreateRepoDialog {
|
||||
relay_input,
|
||||
state,
|
||||
grasp_state,
|
||||
dock,
|
||||
workspace,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -105,7 +109,7 @@ impl CreateRepoDialog {
|
||||
backend.create_repository(&name, &description, folder, servers, cx)
|
||||
});
|
||||
let state = self.state.clone();
|
||||
let dock = self.dock.clone();
|
||||
let workspace = self.workspace.clone();
|
||||
let handle = window.window_handle();
|
||||
|
||||
cx.spawn(async move |_this, cx| match task.await {
|
||||
@@ -116,7 +120,13 @@ impl CreateRepoDialog {
|
||||
store.record(local_path.clone(), announcement.addr(), cx);
|
||||
});
|
||||
cx.open_with_system(&local_path);
|
||||
open_repo_panel(&dock, &announcement.addr(), Some(&announcement), window, cx);
|
||||
open_repo_panel(
|
||||
&workspace,
|
||||
&announcement.addr(),
|
||||
Some(&announcement),
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
close_global(cx);
|
||||
})
|
||||
.ok();
|
||||
@@ -267,6 +277,6 @@ fn choose_folder(folder_input: &Entity<InputState>, window: &mut Window, cx: &mu
|
||||
}
|
||||
|
||||
/// Opens the create-repository form.
|
||||
pub fn open(dock: WeakEntity<DockState>, window: &mut Window, cx: &mut App) {
|
||||
open_global(CreateRepoDialog::new(dock, window, cx), cx);
|
||||
pub fn open(workspace: WeakEntity<Workspace>, window: &mut Window, cx: &mut App) {
|
||||
open_global(CreateRepoDialog::new(workspace, window, cx), cx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user