# Dismiss stale remote connection modal when switching back to local workspace \(\#53575\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f1d9afff663a1dbc9104da3c84df979e1b000a1d

Requested commit: f1d9afff663a1dbc9104da3c84df979e1b000a1d

Commit: f1d9afff663a1dbc9104da3c84df979e1b000a1d

Tree: abf18f1a6813d6a6c518b2969ca1da66744c91a3

Author: Eric Holk

Committer: GitHub

## Message

```
Dismiss stale remote connection modal when switching back to local workspace (#53575)

When the sidebar opens a remote SSH project, it shows a
`RemoteConnectionModal` on the currently active (local) workspace. After
the connection succeeds and a new remote workspace is created and
activated, the modal on the local workspace was never dismissed.
Switching back to the local workspace (e.g. by activating a thread)
would re-render the local workspace's modal layer, revealing the stale
"Starting proxy..." modal.

Other code paths that show this modal (`recent_projects`, `git_ui`)
already call `modal.finished(cx)` after the connection completes. The
sidebar and agent panel paths were missing this cleanup.

## Changes

- **`remote_connection`**: Added `dismiss_connection_modal()`, a public
utility that finds and dismisses any active `RemoteConnectionModal` on a
given workspace.
- **`sidebar`**: Fixed two call sites (`open_workspace_for_group` and
`open_workspace_and_activate_thread`) to dismiss the modal after the
connection task completes, regardless of success or failure.
- **`agent_ui`**: Fixed `open_worktree_workspace_and_start_thread` to
dismiss the modal after workspace creation completes.

Release Notes:

- (Preview only) Fixed a spurious "Starting proxy..." modal appearing
and hanging when switching back to a local project after opening a
remote SSH project in a multi-project workspace.
```

## Parents

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

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