Skip to content

recent_projects: Fix activation defaulting to main worktree#57321

Merged
danilo-leal merged 1 commit into
mainfrom
recent-projects-worktree
May 21, 2026
Merged

recent_projects: Fix activation defaulting to main worktree#57321
danilo-leal merged 1 commit into
mainfrom
recent-projects-worktree

Conversation

@danilo-leal

Copy link
Copy Markdown
Member

Closes AI-280

When navigating between projects opened in the same window through the recent projects picker, the confirm action would always default to picking the main worktree in a project. So if you were in a Git worktree in project A, switched to project B, and then back to project A, when coming back, you wouldn't be in the Git worktree you were in before. The fix is done through matching by project group key instead of file system paths. Since both the main and linked worktrees share the same key, it will just find the previously active workspace and activate it.

Release Notes:

  • Fixed a bug where navigating through open projects in the same window through the recent projects would always default to the main worktree of a given project, instead of activating the last active worktree/workspace.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 20, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 20, 2026
@MartinYe1234 MartinYe1234 self-requested a review May 21, 2026 19:47

@MartinYe1234 MartinYe1234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Works

@danilo-leal danilo-leal added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit f0cbb42 May 21, 2026
45 checks passed
@danilo-leal danilo-leal deleted the recent-projects-worktree branch May 21, 2026 19:51
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 2, 2026
…stries#57321)

Closes AI-280

When navigating between projects opened in the same window through the
recent projects picker, the confirm action would always default to
picking the main worktree in a project. So if you were in a Git worktree
in project A, switched to project B, and then back to project A, when
coming back, you wouldn't be in the Git worktree you were in before. The
fix is done through matching by project group key instead of file system
paths. Since both the main and linked worktrees share the same key, it
will just find the previously active workspace and activate it.

Release Notes:

- Fixed a bug where navigating through open projects in the same window
through the recent projects would always default to the main worktree of
a given project, instead of activating the last active
worktree/workspace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants