mirror of
https://github.com/openai/codex.git
synced 2026-11-19 23:05:23 +00:00
Add a managed worktree browser to the TUI (#43286)
## What changed Add a searchable “Browse worktrees” option to `/worktree` for local repositories with worktrees enabled. List checkouts from the repository's configured pool, show owner metadata, and let users resume an owner thread or copy a worktree's working directory. Load worktrees asynchronously and discard results after the loading popup is dismissed or the request context changes. Ignore actions from stale requests and offer copying when owner metadata is missing or invalid. ## Testing Add popup snapshots and tests for search, resume and copy actions, stale results, and disabled local worktree operations. Extend lifecycle coverage to verify discovery from repository subdirectories and handling of missing or invalid owner metadata. GitOrigin-RevId: 2b7e694a133278da640b6bb275fd5c1202b271c7
This commit is contained in:
1 parent
8d7cc24a87
commit
b053ef9e5a
13 files changed
+457
-3
No files matched your search
@@ -97,6 +97,26 @@ impl App {
|
||||
AppEvent::ManagedWorktreeCreated(created) => {
|
||||
self.finish_managed_worktree(tui, app_server, *created).await;
|
||||
}
|
||||
AppEvent::BrowseManagedWorktrees => {
|
||||
if let Some(request) = self.chat_widget.request_managed_worktrees() {
|
||||
crate::worktree_browser::fetch(
|
||||
request,
|
||||
self.config.codex_home.to_path_buf(),
|
||||
self.app_event_tx.clone(),
|
||||
);
|
||||
}
|
||||
}
|
||||
AppEvent::ManagedWorktreesLoaded { request, result } => {
|
||||
self.chat_widget.on_managed_worktrees_loaded(request, result);
|
||||
}
|
||||
AppEvent::ManagedWorktreeAction { request, action } => {
|
||||
if let Some(event) = self.chat_widget.managed_worktree_action(&request, action) {
|
||||
self.app_event_tx.send(event);
|
||||
}
|
||||
}
|
||||
AppEvent::ShowManagedWorktreeActions { request, entry } => {
|
||||
self.chat_widget.show_managed_worktree_actions(request, entry);
|
||||
}
|
||||
AppEvent::ChangeWorkingDirectory {
|
||||
thread_id,
|
||||
requested_cwd,
|
||||
|
||||
Reference in new issue
Block a user