# recent_projects: Fix activation defaulting to main worktree \(\#57321\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f0cbb42fa6f3ad45b47d739bb50d79fc1e703f23)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f0cbb42fa6f3ad45b47d739bb50d79fc1e703f23

Requested commit: f0cbb42fa6f3ad45b47d739bb50d79fc1e703f23

Commit: f0cbb42fa6f3ad45b47d739bb50d79fc1e703f23

Tree: f3f16bf81f282051a813af257e712fb06e6c7256

Author: Danilo Leal

Committer: GitHub

## Message

```
recent_projects: Fix activation defaulting to main worktree (#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.
```

## Parents

- [d61ffb8e6b7ccaeb7bb1a5b2f4916ec650e51f76](https://git.cafe/gitcafe/zed/commit/d61ffb8e6b7ccaeb7bb1a5b2f4916ec650e51f76?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f0cbb42fa6f3ad45b47d739bb50d79fc1e703f23?format=markdown)
