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:
2026-11-15 13:37:32 +07:00
parent d79d2c7a27
commit 5bd289b418
29 changed files with 1041 additions and 1242 deletions
+12 -23
View File
@@ -3,15 +3,15 @@ mod helpers;
use assets::CustomIconName;
use gpui::prelude::FluentBuilder as _;
use gpui::{
AnyElement, App, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
Render, SharedString, Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window,
div, px, uniform_list,
AnyElement, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
SharedString, Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window, div, px,
uniform_list,
};
use gpui_native_kit::common::{h_flex, v_flex};
use gpui_native_kit::empty_state::EmptyState;
use gpui_native_kit::icons::{Icon, IconRole};
use gpui_native_kit::input::{Input, InputState, InputStateEvent};
use gpui_native_kit::layout::dock::{DockState, Panel};
use gpui_native_kit::layout::panel::Panel;
use gpui_native_kit::scrollbar::Scrollbar;
use gpui_native_kit::segmented::{Segmented, SegmentedOption};
use gpui_native_kit::theme::{ActiveTheme as _, TextRole, Typeset as _};
@@ -20,12 +20,14 @@ use metadata::ProfileDirectory;
use nostr::prelude::PublicKey;
use signed_state::RepoListStore;
use crate::workspace::Workspace;
const COLUMNS: usize = 2;
const CARD_HEIGHT: f32 = 40. + 64. + 48. + 2. + 6.;
pub struct ExploreView {
store: Entity<RepoListStore>,
dock: WeakEntity<DockState>,
workspace: WeakEntity<Workspace>,
scroll_handle: UniformListScrollHandle,
filter: RepoFilter,
/// Indices matching [`Self::filter`] into the store's `announcements`.
@@ -38,7 +40,7 @@ pub struct ExploreView {
}
impl ExploreView {
pub fn new(dock: WeakEntity<DockState>, cx: &mut Context<Self>) -> Self {
pub fn new(workspace: WeakEntity<Workspace>, cx: &mut Context<Self>) -> Self {
let store = RepoListStore::global(cx);
let directory = ProfileDirectory::new(cx);
@@ -63,7 +65,7 @@ impl ExploreView {
Self {
store,
dock,
workspace,
scroll_handle: UniformListScrollHandle::new(),
filter: RepoFilter::default(),
visible: Vec::new(),
@@ -146,20 +148,7 @@ impl ExploreView {
}
}
impl Panel for ExploreView {
fn title(&self, _cx: &App) -> Option<SharedString> {
Some(SharedString::from("Explore"))
}
fn lead(&self, cx: &App) -> Option<AnyElement> {
Some(
Icon::named(CustomIconName::Globe)
.small()
.color(cx.theme().colors.muted_foreground)
.into_any_element(),
)
}
}
impl Panel for ExploreView {}
impl Render for ExploreView {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
@@ -169,7 +158,7 @@ impl Render for ExploreView {
let count = self.visible.len();
let visible = self.visible.clone();
let directory = self.directory.clone();
let dock = self.dock.clone();
let workspace = self.workspace.clone();
let has_repos = count > 0;
let rows = visible.len().div_ceil(COLUMNS);
@@ -207,7 +196,7 @@ impl Render for ExploreView {
activity,
&announcements,
&directory,
&dock,
&workspace,
cx,
));
}