Lightweight coding agent that runs in your terminal
Rust
Clarify Git worktree choices for new and forked conversations (#50416)
Benjamin Carlssondff5270b298b
diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_fork_choices.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_fork_choices.snapindex 44c9b2da24..5467ee986f 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_fork_choices.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_fork_choices.snap@@ -5,7 +5,8 @@ expression: popupWhere should the forked conversation run?-› 1. Current checkout Keep using the current working directory- 2. New worktree Create an isolated managed checkout+› 1. Use current Git worktree Keep using the current working directory+ 2. Create new Git worktree Create a separate checkout of this repository in+ another directoryenter select · esc backdiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_new_choices.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_new_choices.snapindex fe690b2a92..306a280636 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_new_choices.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__worktrees_new_choices.snap@@ -5,7 +5,8 @@ expression: popupWhere should the new conversation run?-› 1. Current checkout Keep using the current working directory- 2. New worktree Create an isolated managed checkout+› 1. Use current Git worktree Keep using the current working directory+ 2. Create new Git worktree Create a separate checkout of this repository in+ another directoryenter select · esc backdiff --git a/codex-rs/tui/src/chatwidget/tests/worktree_picker_tests.rs b/codex-rs/tui/src/chatwidget/tests/worktree_picker_tests.rsindex 5fdc5b3628..916fb1e8fd 100644--- a/codex-rs/tui/src/chatwidget/tests/worktree_picker_tests.rs+++ b/codex-rs/tui/src/chatwidget/tests/worktree_picker_tests.rs@@ -32,8 +32,8 @@ async fn slash_new_and_fork_offer_checkout_choices_inside_local_git_repository()chat.dispatch_command(SlashCommand::New);let popup = render_bottom_popup(&chat, /*width*/ 80);assert_chatwidget_snapshot!("worktrees_new_choices", popup);- assert!(popup.contains("Current checkout"), "popup: {popup}");- assert!(popup.contains("New worktree"), "popup: {popup}");+ assert!(popup.contains("Use current Git worktree"), "popup: {popup}");+ assert!(popup.contains("Create new Git worktree"), "popup: {popup}");assert_matches!(rx.try_recv(), Err(TryRecvError::Empty));chat.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));chat.bottom_panediff --git a/codex-rs/tui/src/chatwidget/worktree_picker.rs b/codex-rs/tui/src/chatwidget/worktree_picker.rsindex cdff579b36..ef06ff2776 100644--- a/codex-rs/tui/src/chatwidget/worktree_picker.rs+++ b/codex-rs/tui/src/chatwidget/worktree_picker.rs@@ -46,7 +46,7 @@ impl ChatWidget {title: Some(title.into()),items: vec![SelectionItem {- name: "Current checkout".to_string(),+ name: "Use current Git worktree".to_string(),description: Some("Keep using the current working directory".to_string()),actions: vec![Box::new(move |tx| match mode {ManagedWorktreeMode::New => {@@ -64,8 +64,11 @@ impl ChatWidget {..Default::default()},SelectionItem {- name: "New worktree".to_string(),- description: Some("Create an isolated managed checkout".to_string()),+ name: "Create new Git worktree".to_string(),+ description: Some(+ "Create a separate checkout of this repository in another directory"+ .to_string(),+ ),actions: vec![Box::new(move |tx| {tx.send(AppEvent::StartManagedWorktree {mode,