wire explore view into workspace and titlebar
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run

This commit is contained in:
2026-11-17 19:23:26 +07:00
parent c63acc8867
commit b491ae9d03
5 changed files with 60 additions and 13 deletions
+21 -3
View File
@@ -2,9 +2,9 @@ mod helpers;
use gpui::prelude::FluentBuilder as _;
use gpui::{
AnyElement, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _, Render,
SharedString, Styled as _, Subscription, UniformListScrollHandle, WeakEntity, Window, div, px,
uniform_list,
AnyElement, App, AppContext as _, Context, Entity, InteractiveElement as _, IntoElement,
ParentElement as _, Render, SharedString, Styled as _, Subscription, UniformListScrollHandle,
WeakEntity, Window, div, px, uniform_list,
};
use helpers::{RepoFilter, render_card};
use metadata::ProfileDirectory;
@@ -19,6 +19,7 @@ use ui::scrollbar::Scrollbar;
use ui::segmented::{Segmented, SegmentedOption};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use crate::shared::panels;
use crate::workspace::Workspace;
const COLUMNS: usize = 2;
@@ -39,6 +40,23 @@ pub struct ExploreView {
}
impl ExploreView {
/// The identifier of the explore panel in the workspace; shown as its tab label.
pub(crate) const PANEL_ID: &'static str = "Explore";
/// Opens the explore panel in the main panel, reusing it when it is already cached.
pub(crate) fn open(workspace: &WeakEntity<Workspace>, window: &mut Window, cx: &mut App) {
panels::open_primary(
workspace,
Self::PANEL_ID,
{
let workspace = workspace.clone();
move |_, cx| cx.new(|cx| Self::new(workspace.clone(), cx))
},
window,
cx,
);
}
pub fn new(workspace: WeakEntity<Workspace>, cx: &mut Context<Self>) -> Self {
let store = RepoListStore::global(cx);
let directory = ProfileDirectory::new(cx);