Skip to content

recent_projects: Fix remote workspace activation - #59093

Closed
clarkenciel wants to merge 3 commits into
zed-industries:mainfrom
clarkenciel:fix-58646-wsl-recent-projects
Closed

recent_projects: Fix remote workspace activation#59093
clarkenciel wants to merge 3 commits into
zed-industries:mainfrom
clarkenciel:fix-58646-wsl-recent-projects

Conversation

@clarkenciel

Copy link
Copy Markdown
Contributor

Workspace reactivation in the recent projects popover didn't handle
remote workspaces correctly in a fresh zed window. Rather than
activating the remote workspace, it would open a user's home directory
with a single editor titled after the remote workspace's directory.
E.g. rather than opening my_project in WSL2, it would open ~ with
a single editor called my_project.

Notably, the threads manager in the sidebar handles this correctly and
so this fix essentially ports Sidebar::open_workspace_for_group to
RecentProjects::confirm. There is probably some work worth doing
to factor out this code and use it in both places, but that feels
big enough to defer to another change.

The key to reproduction is to use a fresh zed window that has recently
opened projects. In this case the
MultiWorkspace::last_active_workspace_for_group lookup on L1159 will
return None. This will cause zed to fall through to the
MultiWorkspace::find_or_create_local_workspace call on L1173. Because
the selected workspace is a remote workspace, many of the checks in
MultiWorkspace::find_or_create_local_workspace_with_source_workspace
fail and we bottom out in multi_workspace.rs:L1421 where a new, empty
local workspace is created.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #58646

Release Notes:

  • Fixed bug in recent projects picker that caused recent WSL projects to open in broken local workspaces.

@cla-bot

cla-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @clarkenciel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jun 11, 2026
@clarkenciel
clarkenciel marked this pull request as draft June 11, 2026 03:19
@clarkenciel

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 11, 2026
@cla-bot

cla-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@clarkenciel

Copy link
Copy Markdown
Contributor Author

A demonstration of the bug:
https://github.com/user-attachments/assets/d1012030-cab8-480a-8961-9964faa2c261

and a demonstration of zed with my patch:
https://github.com/user-attachments/assets/cfd9910d-3179-46aa-9db7-81c2a3d2ff15

NB: in the fix video the popover flickers. that is unrelated to my patch: my mouse's primary button is a bit on the fritz at the moment.

@clarkenciel
clarkenciel marked this pull request as ready for review June 11, 2026 03:51
@ChristopherBiscardi ChristopherBiscardi added the area:workspace Feedback for workspace management, layout, interactions, etc label Jun 12, 2026
@clarkenciel
clarkenciel force-pushed the fix-58646-wsl-recent-projects branch from 517e60a to b0dcda3 Compare June 12, 2026 03:34
@Veykril Veykril self-assigned this Jun 12, 2026
@Veykril
Veykril self-requested a review June 12, 2026 05:52
@clarkenciel
clarkenciel force-pushed the fix-58646-wsl-recent-projects branch from b0dcda3 to 9ff8372 Compare June 13, 2026 18:10
Fixes zed-industries#58646.

Workspace reactivation in the recent projects popover didn't handle
remote workspaces correctly in a fresh zed window. Rather than
activating the remote workspace, it would open a user's home directory
with a single editor titled after the remote workspace's directory.
E.g. rather than opening `my_project` in WSL2, it would open `~` with
a single editor called `my_project`.

Notably, the threads manager in the sidebar handles this correctly and
so this fix essentially ports `Sidebar::open_workspace_for_group` to
`RecentProjects::confirm`. There is probably some work worth doing
to factor out this code and use it in both places, but that feels
big enough to defer to another change.

The key to reproduction is to use a fresh zed window that has recently
opened projects. In this case the
`MultiWorkspace::last_active_workspace_for_group` lookup on L1159 will
return `None`. This will cause zed to fall through to the
`MultiWorkspace::find_or_create_local_workspace` call on L1173. Because
the selected workspace is a remote workspace, many of the checks in
`MultiWorkspace::find_or_create_local_workspace_with_source_workspace`
fail and we bottom out in `multi_workspace.rs:L1421` where a new, empty
local workspace is created.
@clarkenciel
clarkenciel force-pushed the fix-58646-wsl-recent-projects branch from 9ff8372 to 7b9a312 Compare June 13, 2026 18:15
@clarkenciel

Copy link
Copy Markdown
Contributor Author

Closing since it looks like #59272 does the same.

@Veykril

Veykril commented Jun 17, 2026

Copy link
Copy Markdown
Member

Ah so sorry, for not getting to this first 🙇 but thank you so much for looking into this either way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Feedback for workspace management, layout, interactions, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WSL] Using Recent Projects does not work when switching projects - After Agentic View was introduced

3 participants