refactor: replace shell with root view wrapping app content
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

This commit is contained in:
2026-11-22 21:45:09 +07:00
parent 531493008e
commit ccaa48a112
17 changed files with 259 additions and 284 deletions
+32 -35
View File
@@ -276,9 +276,7 @@ impl NewPullRequestView {
let active_fork = self.fork.as_ref().map(|fork| fork.announcement.addr());
let can_submit = self.submit_enabled(cx);
let source_label = match &self.fork {
Some(fork) => truncate_label(&announcement_display_name(
&fork.announcement,
)),
Some(fork) => truncate_label(&announcement_display_name(&fork.announcement)),
None => self.repo_path.as_ref().map_or_else(
|| SharedString::from("No source"),
|path| truncate_label(&path.display().to_string()),
@@ -305,32 +303,35 @@ impl NewPullRequestView {
.child(div().w(px(160.)).child(self.compare_select.clone())),
)
.child(
v_flex().gap_1().child(div().text_xs().font_medium().child("Source")).child(
Menu::new("pr-source")
.open(self.source_open)
.on_change(move |open, _, cx| {
log_dropped(weak_menu.update(cx, |this, cx| {
this.source_open = open;
cx.notify();
}));
})
.trigger(move |_, _| {
Button::new("compare-source")
.label(source_label.clone())
.variant(ButtonVariant::Secondary)
.into_any_element()
})
.items(move |_, _| {
super::helpers::source_menu_items(
source_view.clone(),
associated.clone(),
active_path.clone(),
candidates.clone(),
user,
active_fork.clone(),
)
}),
),
v_flex()
.gap_1()
.child(div().text_xs().font_medium().child("Source"))
.child(
Menu::new("pr-source")
.open(self.source_open)
.on_change(move |open, _, cx| {
log_dropped(weak_menu.update(cx, |this, cx| {
this.source_open = open;
cx.notify();
}));
})
.trigger(move |_, _| {
Button::new("compare-source")
.label(source_label.clone())
.variant(ButtonVariant::Secondary)
.into_any_element()
})
.items(move |_, _| {
super::helpers::source_menu_items(
source_view.clone(),
associated.clone(),
active_path.clone(),
candidates.clone(),
user,
active_fork.clone(),
)
}),
),
)
.when_some(refresh_fork, |this, fork| {
this.child(
@@ -349,9 +350,7 @@ impl NewPullRequestView {
.loading(self.submitting)
.disabled(!can_submit)
.on_click(move |_, window, cx| {
log_dropped(
weak.update(cx, |this, cx| this.submit(window, cx)),
);
log_dropped(weak.update(cx, |this, cx| this.submit(window, cx)));
}),
)
.into_any_element()
@@ -385,9 +384,7 @@ impl NewPullRequestView {
return Spinner::centered("new-pr-loading");
}
if !self.has_source() {
return EmptyState::centered(
"Choose a local checkout or an announced fork to compare",
);
return EmptyState::centered("Choose a local checkout or an announced fork to compare");
}
if self.commits.is_none() && self.error.is_some() {
return EmptyState::centered("Nothing to compare");