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( dock: &WeakEntity, id: impl Into, build: F, window: &mut Window, cx: &mut App, ) where P: Panel + 'static, F: Fn(&mut Window, &mut App) -> Entity

+ '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}"); } }