open repo panels from sidebar rows
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-11 20:12:44 +07:00
parent 1f65a0111f
commit 89e718cb6a
21 changed files with 4537 additions and 25 deletions
+22
View File
@@ -1 +1,23 @@
use gpui::{App, Entity, SharedString, WeakEntity, Window};
use gpui_native_kit::layout::dock::{DockState, Panel};
/// Registers a panel builder under `id` and opens it in the dock.
pub fn open<P, F>(
dock: &WeakEntity<DockState>,
id: impl Into<SharedString>,
build: F,
window: &mut Window,
cx: &mut App,
) where
P: Panel + 'static,
F: Fn(&mut Window, &mut App) -> Entity<P> + 'static,
{
let id = id.into();
if let Err(error) = dock.update(cx, |dock, cx| {
dock.register_panel(id.clone(), build);
dock.open_panel(&id, window, cx);
}) {
log::warn!("failed to open panel {id}: {error}");
}
}