chore: move new issue/pull form into a split panel
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-25 10:01:11 +07:00
parent e54364b716
commit f305c56e9e
18 changed files with 576 additions and 451 deletions
+2 -15
View File
@@ -1,5 +1,5 @@
//! The shared issue and pull-request lists: toolbar, uniform rows, scrollbar
//! overlay, and empty state, plus the scrollable commit list.
//! The shared issue and pull-request lists: uniform rows, scrollbar overlay, and
//! empty state, plus the scrollable commit list.
use std::rc::Rc;
use std::sync::Arc;
@@ -189,19 +189,6 @@ impl EventList {
}
}
/// The toolbar above the issue and pull-request lists: a filter and its actions.
pub fn filter_toolbar(cx: &App, children: impl IntoIterator<Item = AnyElement>) -> AnyElement {
h_flex()
.px_4()
.w_full()
.gap_3()
.border_b_1()
.border_color(cx.theme().colors.border)
.bg(cx.theme().colors.muted)
.children(children)
.into_any_element()
}
/// A scrollable commit list: uniform `commit_row`s under a scrollbar overlay.
pub fn commit_list(
id: &'static str,
-1
View File
@@ -3,7 +3,6 @@ use metadata::ProfileDirectory;
use nostr::prelude::PublicKey;
pub mod event_list;
pub mod panels;
pub mod progress;
pub mod widgets;
-67
View File
@@ -1,67 +0,0 @@
use gpui::{App, AppContext, Entity, SharedString, WeakEntity, Window};
use ui::layout::panel::{Panel, PanelSlot};
use crate::app::AppRoot;
use crate::shared::log_dropped;
/// Opens a panel in `slot`, reusing it when it is already open.
fn open_slot<P, F>(
slot: PanelSlot,
workspace: &WeakEntity<AppRoot>,
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 result = workspace.update(cx, |workspace, cx| {
workspace
.panels()
.clone()
.update(cx, |panels, cx| panels.open(slot, id, build, window, cx))
});
if let Err(error) = result {
log::warn!("failed to open panel: {error}");
}
}
/// Opens a repository in the main panel, reusing it when it is already open.
pub fn open_primary<P, F>(
workspace: &WeakEntity<AppRoot>,
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,
{
open_slot(PanelSlot::Main, workspace, id, build, window, cx);
}
/// Opens a detail panel beside the main panel, reusing it when it is already open.
pub fn open_detail<P, F>(
workspace: &WeakEntity<AppRoot>,
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,
{
open_slot(PanelSlot::Split, workspace, id, build, window, cx);
}
/// Closes the detail panel open under `id`.
pub fn close_detail(workspace: &WeakEntity<AppRoot>, id: &SharedString, cx: &mut impl AppContext) {
let result = workspace.update(cx, |workspace, cx| {
workspace
.panels()
.clone()
.update(cx, |panels, cx| panels.close(PanelSlot::Split, id, cx))
});
log_dropped(result);
}