Skip to content

[RFC] Add worktree-aware directory switcher#8450

Open
vincenzopalazzo wants to merge 4 commits intoaaif-goose:mainfrom
vincenzopalazzo:feature/chat-search-rework
Open

[RFC] Add worktree-aware directory switcher#8450
vincenzopalazzo wants to merge 4 commits intoaaif-goose:mainfrom
vincenzopalazzo:feature/chat-search-rework

Conversation

@vincenzopalazzo
Copy link
Copy Markdown
Contributor

@vincenzopalazzo vincenzopalazzo commented Apr 9, 2026

Summary

  • add a worktree-aware directory switcher to the desktop chat input bottom bar
  • replace the old click-to-open-directory-picker behavior with a dropdown menu
  • show the current directory, detected Git worktrees for the active repo, and recent directories
  • keep quick actions for choosing another directory and opening the current directory in the system file manager
  • expose Electron APIs for recent directories and Git worktree discovery
  • add i18n strings for the new directory switcher UI

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 typecheck
  • source bin/activate-hermit && cd ui/desktop && pnpm run lint:check

@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-search-rework branch from e27dc7c to 038910b Compare April 9, 2026 18:21
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx Outdated
Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx Outdated
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-search-rework branch from 038910b to a1928e8 Compare April 9, 2026 18:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx Outdated
Comment thread ui/desktop/src/components/conversation/ChatHistorySearch.tsx Outdated
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-search-rework branch from 901ed0e to 452ed70 Compare April 9, 2026 19:17
@vincenzopalazzo vincenzopalazzo changed the title Honor Ollama timeout during streaming [RFC] Add worktree-aware directory switcher Apr 9, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ui/desktop/src/components/bottom_menu/DirSwitcher.tsx
vincenzopalazzo and others added 3 commits April 16, 2026 00:49
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>
@vincenzopalazzo vincenzopalazzo force-pushed the feature/chat-search-rework branch from 39ac580 to 68bf21e Compare April 15, 2026 22:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +85 to +90
useEffect(() => {
if (!isMenuOpen) {
return;
}

const newDir = result.filePaths[0];
void refreshMenuData();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant