Add Git worktree pane

This commit is contained in:
Georg Bauer
2026-07-27 19:44:12 +02:00
parent aebfe7aeb6
commit b9933ae076
9 changed files with 2630 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
mod a2ui;
mod chat;
mod git;
mod model_manager;
mod preferences;
mod stats;
@@ -102,6 +103,8 @@ impl App {
/// tree, so the layers below have to stay out of the dialog's field order.
pub(super) fn modal_open(&self) -> bool {
self.quit_confirmation
|| self.git_diff.is_some()
|| self.git_commit_all_confirmation
|| self.pending_project_path.is_some()
|| self.pending_session_delete.is_some()
|| self.session_rename.is_some()
@@ -176,6 +179,10 @@ impl App {
layers.push(self.session_menu_panel(session));
} else if let Some(surface_id) = &self.pending_a2ui_dismissal {
layers.push(self.a2ui_dismiss_panel(surface_id));
} else if self.git_commit_all_confirmation {
layers.push(self.git_commit_all_panel());
} else if self.git_diff.is_some() {
layers.push(self.git_diff_panel());
} else if let Some(panel) = self.a2ui_modal_panel() {
layers.push(panel);
}
@@ -192,6 +199,10 @@ impl App {
layers.push(self.session_menu_panel(session));
} else if let Some(surface_id) = &self.pending_a2ui_dismissal {
layers.push(self.a2ui_dismiss_panel(surface_id));
} else if self.git_commit_all_confirmation {
layers.push(self.git_commit_all_panel());
} else if self.git_diff.is_some() {
layers.push(self.git_diff_panel());
} else if let Some(panel) = self.a2ui_modal_panel() {
layers.push(panel);
}
@@ -505,6 +516,7 @@ impl App {
fn detail_tabs(&self) -> Element<'_, Message> {
let chat_active = self.detail_tab == DetailTab::Chat;
let a2ui_active = self.detail_tab == DetailTab::A2ui;
let git_active = self.detail_tab == DetailTab::Git;
let stats_active = self.detail_tab == DetailTab::Stats;
let tabs = container(
row![
@@ -520,6 +532,12 @@ impl App {
.padding([0, 16])
.on_press(Message::ShowA2ui)
.style(move |theme, status| segmented_button_style(theme, status, a2ui_active)),
button(text("Git").size(13))
.width(88)
.height(TITLE_BAR_CONTROL - 4.0)
.padding([0, 16])
.on_press(Message::ShowGit)
.style(move |theme, status| segmented_button_style(theme, status, git_active)),
button(text("Stats").size(13))
.width(88)
.height(TITLE_BAR_CONTROL - 4.0)
@@ -542,6 +560,7 @@ impl App {
match self.detail_tab {
DetailTab::Chat => self.chat_detail(),
DetailTab::A2ui => self.a2ui_detail(),
DetailTab::Git => self.git_detail(),
DetailTab::Stats => self.stats_dashboard(),
}
}