[RFC] Add worktree-aware directory switcher#8450
[RFC] Add worktree-aware directory switcher#8450vincenzopalazzo wants to merge 4 commits intoaaif-goose:mainfrom
Conversation
e27dc7c to
038910b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e27dc7c6f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
038910b to
a1928e8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 901ed0e99c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
901ed0e to
452ed70
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 452ed708e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Add a version counter ref so that out-of-order IPC responses from listRecentDirs/listGitWorktreeDirs are discarded when a newer refresh has already been started. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: goose <goose@aaif.dev> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
39ac580 to
68bf21e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68bf21e9a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| useEffect(() => { | ||
| if (!isMenuOpen) { | ||
| return; | ||
| } | ||
|
|
||
| const newDir = result.filePaths[0]; | ||
| void refreshMenuData(); |
There was a problem hiding this comment.
Clear stale worktree options when opening the switcher
worktreeDirs is rendered immediately from component state, but this effect only refreshes data asynchronously after the menu opens and does nothing while closed. If workingDir changes between openings, the previous repo’s worktree entries remain visible and clickable until refreshMenuData() finishes, so a fast click can switch the user to an unrelated directory. Reset or hide worktree options until the fetch for the current workingDir completes.
Useful? React with 👍 / 👎.
Co-authored-by: goose <goose@aaif.dev> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Summary
Why
Working on multiple branches and tasks at the same time is much smoother when each task lives in its own Git worktree. Right now, switching the Goose desktop app between those worktrees is slower than it needs to be because the only path is reopening a directory picker or creating separate windows manually.
This RFC proposes a lightweight in-app worktree toggle so users can jump between related worktrees directly from the chat input, similar to the workflow Claude supports. The goal is to make parallel task switching faster and more discoverable without changing the broader session model.
Test plan
source bin/activate-hermit && cd ui/desktop && pnpm run typechecksource bin/activate-hermit && cd ui/desktop && pnpm run lint:check