feat: open issue and pull request details in a new tab
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-26 10:40:00 +07:00
parent ae41fac60a
commit 5363544b9d
9 changed files with 128 additions and 100 deletions
+3
View File
@@ -15,10 +15,13 @@
- Reuse the rendered file tree, commit diffs, README previews and split pane instead of rebuilding them on every repaint - Reuse the rendered file tree, commit diffs, README previews and split pane instead of rebuilding them on every repaint
- Truncate long tab and file tree labels with an ellipsis instead of letting them widen their row - Truncate long tab and file tree labels with an ellipsis instead of letting them widen their row
- Open the New issue form in a split panel instead of a dialog, it now stays open until the issue is published and shows a failed publish in the form - Open the New issue form in a split panel instead of a dialog, it now stays open until the issue is published and shows a failed publish in the form
- Open issue and pull request details in a new tab instead of the split panel
- Show the panel toolbar on the New issue, New pull request and Send patch split panels
- Show each commit of the Commits list on one row with its author avatar and name, short id and summary - Show each commit of the Commits list on one row with its author avatar and name, short id and summary
### Fixed ### Fixed
- Fix the status badge on issue and pull request rows sitting below the title instead of centered with it
- Fix opening a local repository or switching its branch discarding uncommitted changes, a checkout now refuses to overwrite uncommitted edits or untracked files and leaves the branch untouched when it fails - Fix opening a local repository or switching its branch discarding uncommitted changes, a checkout now refuses to overwrite uncommitted edits or untracked files and leaves the branch untouched when it fails
- Fix viewing a commit diff crashing when the repository configures an external diff driver - Fix viewing a commit diff crashing when the repository configures an external diff driver
- Fix an unreadable `settings.json` being replaced by defaults on the next settings change, the file is now left untouched and the error is shown in Settings - Fix an unreadable `settings.json` being replaced by defaults on the next settings change, the file is now left untouched and the error is shown in Settings
+8 -3
View File
@@ -259,7 +259,6 @@ impl Render for IssuesView {
.id(SharedString::from(format!("issue:{id_hex}"))) .id(SharedString::from(format!("issue:{id_hex}")))
.w_full() .w_full()
.h_16() .h_16()
.gap_4()
.px_2() .px_2()
.border_b_1() .border_b_1()
.border_color(cx.theme().colors.border) .border_color(cx.theme().colors.border)
@@ -273,7 +272,7 @@ impl Render for IssuesView {
cx, cx,
|panels, cx| { |panels, cx| {
panels.open( panels.open(
PanelSlot::Split, PanelSlot::Main,
id, id,
move |_, cx| { move |_, cx| {
cx.new(|cx| { cx.new(|cx| {
@@ -291,7 +290,12 @@ impl Render for IssuesView {
) )
})); }));
}) })
.child(status_badge(status)) .child(
h_flex()
.w_full()
.items_start()
.gap_2()
.child(h_flex().w_24().child(status_badge(status)))
.child( .child(
v_flex() v_flex()
.flex_1() .flex_1()
@@ -335,6 +339,7 @@ impl Render for IssuesView {
) )
.child(relative_time(issue.created_at)), .child(relative_time(issue.created_at)),
), ),
),
) )
.into_any_element() .into_any_element()
}) })
@@ -116,6 +116,10 @@ impl Panel for NewIssueView {
fn loading(&self, _cx: &App) -> bool { fn loading(&self, _cx: &App) -> bool {
self.submitting self.submitting
} }
fn toolbar(&self, _cx: &App) -> bool {
true
}
} }
impl Render for NewIssueView { impl Render for NewIssueView {
@@ -130,6 +134,7 @@ impl Render for NewIssueView {
.gap_3() .gap_3()
.child( .child(
div() div()
.pr_16()
.text_base() .text_base()
.text_color(cx.theme().colors.muted_foreground) .text_color(cx.theme().colors.muted_foreground)
.child("Report a bug, ask a question, or propose a change."), .child("Report a bug, ask a question, or propose a change."),
+11 -3
View File
@@ -310,6 +310,7 @@ impl Render for PullRequestsView {
this.child( this.child(
Alert::new("pr-warning") Alert::new("pr-warning")
.severity(AlertSeverity::Warning) .severity(AlertSeverity::Warning)
.style(ui::alert::AlertStyle::Inline)
.title("Pull request warning") .title("Pull request warning")
.message(warning) .message(warning)
.on_dismiss(move |cx| { .on_dismiss(move |cx| {
@@ -324,6 +325,7 @@ impl Render for PullRequestsView {
this.child( this.child(
Alert::new("pr-error") Alert::new("pr-error")
.severity(AlertSeverity::Danger) .severity(AlertSeverity::Danger)
.style(ui::alert::AlertStyle::Inline)
.title("Pull request error") .title("Pull request error")
.message(error) .message(error)
.on_dismiss(move |cx| { .on_dismiss(move |cx| {
@@ -352,6 +354,7 @@ impl Render for PullRequestsView {
}) else { }) else {
return div().into_any_element(); return div().into_any_element();
}; };
let profile = directory.read(cx).profile(&pr.pubkey, cx); let profile = directory.read(cx).profile(&pr.pubkey, cx);
let pr_id = pr.id; let pr_id = pr.id;
let id_hex = pr.id.to_hex(); let id_hex = pr.id.to_hex();
@@ -363,7 +366,6 @@ impl Render for PullRequestsView {
.id(SharedString::from(format!("pr:{id_hex}"))) .id(SharedString::from(format!("pr:{id_hex}")))
.w_full() .w_full()
.h_16() .h_16()
.gap_4()
.px_2() .px_2()
.border_b_1() .border_b_1()
.border_color(cx.theme().colors.border) .border_color(cx.theme().colors.border)
@@ -378,7 +380,7 @@ impl Render for PullRequestsView {
cx, cx,
|panels, cx| { |panels, cx| {
panels.open( panels.open(
PanelSlot::Split, PanelSlot::Main,
id, id,
move |window, cx| { move |window, cx| {
cx.new(|cx| { cx.new(|cx| {
@@ -399,7 +401,12 @@ impl Render for PullRequestsView {
) )
})); }));
}) })
.child(status_badge(status)) .child(
h_flex()
.w_full()
.items_start()
.gap_2()
.child(h_flex().w_24().child(status_badge(status)))
.child( .child(
v_flex() v_flex()
.flex_1() .flex_1()
@@ -443,6 +450,7 @@ impl Render for PullRequestsView {
) )
.child(relative_time(pr.created_at)), .child(relative_time(pr.created_at)),
), ),
),
) )
.into_any_element() .into_any_element()
}) })
@@ -328,6 +328,7 @@ impl NewPullRequestView {
h_flex() h_flex()
.px_4() .px_4()
.pr_16()
.py_2() .py_2()
.w_full() .w_full()
.gap_3() .gap_3()
@@ -950,6 +951,10 @@ impl Panel for NewPullRequestView {
fn loading(&self, _cx: &App) -> bool { fn loading(&self, _cx: &App) -> bool {
self.loading self.loading
} }
fn toolbar(&self, _cx: &App) -> bool {
true
}
} }
impl Render for NewPullRequestView { impl Render for NewPullRequestView {
@@ -137,6 +137,10 @@ impl Panel for SendPatchView {
fn loading(&self, _cx: &App) -> bool { fn loading(&self, _cx: &App) -> bool {
self.submitting self.submitting
} }
fn toolbar(&self, _cx: &App) -> bool {
true
}
} }
impl Render for SendPatchView { impl Render for SendPatchView {
@@ -149,7 +153,9 @@ impl Render for SendPatchView {
.p_4() .p_4()
.flex_1() .flex_1()
.gap_2() .gap_2()
.child(Input::new("patch-subject", self.subject.clone()).placeholder("Title")) .child(div().pr_16().child(
Input::new("patch-subject", self.subject.clone()).placeholder("Title"),
))
.child( .child(
Input::new("patch-description", self.description.clone()) Input::new("patch-description", self.description.clone())
.rows(2) .rows(2)
+9 -15
View File
@@ -5,6 +5,8 @@ use signed_state::RepoStore;
use ui::layout::panel::PanelSlot; use ui::layout::panel::PanelSlot;
use crate::app::AppRoot; use crate::app::AppRoot;
use crate::issues::detail::IssueDetailView;
use crate::pull_requests::PullRequestDetailView;
use crate::repo::RepoDetailView; use crate::repo::RepoDetailView;
use crate::shared::log_dropped; use crate::shared::log_dropped;
@@ -29,7 +31,7 @@ pub fn open_repo_panel(
let workspace_for_build = workspace.clone(); let workspace_for_build = workspace.clone();
log_dropped(workspace.update(cx, |root, cx| { log_dropped(workspace.update(cx, |root, cx| {
root.panels().clone().update(cx, |panels, cx| { root.panels().update(cx, |panels, cx| {
panels.open( panels.open(
PanelSlot::Main, PanelSlot::Main,
id, id,
@@ -62,19 +64,11 @@ pub fn open_repo_item(
let id = SharedString::from(format!("issue:{issue_id}")); let id = SharedString::from(format!("issue:{issue_id}"));
let store = store.clone(); let store = store.clone();
log_dropped(workspace.update(cx, |root, cx| { log_dropped(workspace.update(cx, |root, cx| {
root.panels().clone().update(cx, |panels, cx| { root.panels().update(cx, |panels, cx| {
panels.open( panels.open(
PanelSlot::Split, PanelSlot::Main,
id, id,
move |_, cx| { move |_, cx| cx.new(|cx| IssueDetailView::new(store.clone(), issue_id, cx)),
cx.new(|cx| {
crate::issues::detail::IssueDetailView::new(
store.clone(),
issue_id,
cx,
)
})
},
window, window,
cx, cx,
) )
@@ -86,13 +80,13 @@ pub fn open_repo_item(
let workspace_for_build = workspace.clone(); let workspace_for_build = workspace.clone();
let store = store.clone(); let store = store.clone();
log_dropped(workspace.update(cx, |root, cx| { log_dropped(workspace.update(cx, |root, cx| {
root.panels().clone().update(cx, |panels, cx| { root.panels().update(cx, |panels, cx| {
panels.open( panels.open(
PanelSlot::Split, PanelSlot::Main,
id, id,
move |window, cx| { move |window, cx| {
cx.new(|cx| { cx.new(|cx| {
crate::pull_requests::PullRequestDetailView::new( PullRequestDetailView::new(
workspace_for_build.clone(), workspace_for_build.clone(),
store.clone(), store.clone(),
pr_id, pr_id,
+3 -2
View File
@@ -14,7 +14,7 @@ use gpui::prelude::FluentBuilder as _;
use gpui::{ use gpui::{
AnyView, App, ElementId, Hsla, InteractiveElement as _, IntoElement, ParentElement as _, AnyView, App, ElementId, Hsla, InteractiveElement as _, IntoElement, ParentElement as _,
RenderOnce, SharedString, StatefulInteractiveElement as _, StyleRefinement, Styled as _, RenderOnce, SharedString, StatefulInteractiveElement as _, StyleRefinement, Styled as _,
Window, transparent_black, Window, relative, transparent_black,
}; };
use crate::components::common::{ControlSizing, Sizable, StyledExt, h_flex}; use crate::components::common::{ControlSizing, Sizable, StyledExt, h_flex};
@@ -163,9 +163,10 @@ impl RenderOnce for Badge {
.border_color(border) .border_color(border)
.bg(background) .bg(background)
.text_color(foreground) .text_color(foreground)
.line_height(relative(1.0))
.control_caption_text(size) .control_caption_text(size)
.map(|badge| match size { .map(|badge| match size {
Size::XSmall | Size::Small => badge.h_5().min_w_5().px_1(), Size::XSmall | Size::Small => badge.h_5().min_w_5().px_1p5(),
Size::Medium => badge.h_6().min_w_6().px_1p5(), Size::Medium => badge.h_6().min_w_6().px_1p5(),
Size::Large => badge.h_7().min_w_7().px_2(), Size::Large => badge.h_7().min_w_7().px_2(),
}) })
+3 -2
View File
@@ -337,14 +337,15 @@ impl PanelStack {
} }
/// Shows the panel under `id`, building it only when it is not open yet. /// Shows the panel under `id`, building it only when it is not open yet.
pub fn open<P, F>( pub fn open<I, P, F>(
&mut self, &mut self,
slot: PanelSlot, slot: PanelSlot,
id: impl Into<SharedString>, id: I,
build: F, build: F,
window: &mut Window, window: &mut Window,
cx: &mut Context<Self>, cx: &mut Context<Self>,
) where ) where
I: Into<SharedString>,
P: Panel + 'static, P: Panel + 'static,
F: Fn(&mut Window, &mut App) -> Entity<P> + 'static, F: Fn(&mut Window, &mut App) -> Entity<P> + 'static,
{ {