microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.64k stars 285 forks source link

UI: "could not establish connection" dialogue prevents workspace switching #9535

Closed movy closed 3 months ago

movy commented 8 months ago

Version: 1.85.1 (Universal) Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 Date: 2023-12-13T09:48:06.308Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin x64 22.6.0

This is a UI bug, please see repro video below.

Whenever multiple connections fail (i.e. several remote workspaces fail to reconnect), the "could not establish connection to..." dialogues steals focus so to speak (even when it's in background), so it's impossible to switch between workspaces as mouse clicks do not register unless dialogue is dismissed. Usually ALL of these dialogues are attached to a single workspace, so you'd have to seek for it to dismiss it. It was very confusing for several weeks and required VSCode force-restart, until I figured I could switch between workspaces via Menu -> Window dropdown, so I could finally record the video with the problem.

The dialogue is kinda useless anyway (a simple bottom-right corner notification would do in such case), but its UI behaviour is very problematic, hopefully it can be fixed.

https://github.com/microsoft/vscode-remote-release/assets/4336560/488c025c-f8a3-447e-b138-90d3176241e8

chrmarti commented 8 months ago

@deepak1556 I guess this is the macOS behavior with native tabs and modal dialogs?

movy commented 8 months ago

I guess it's MacOS native annoyance. So maybe using any other method (apart from modal) to notify user about disconnection, can solve this.

deepak1556 commented 8 months ago

@chrmarti yes that is the intended behavior of modal dialogs.

@movy doesn't the tabs auto focus when the dialogs are prompted ? Is the request to allow using other tabs while the dialogs are active ?

movy commented 8 months ago

The tabs are autofocused, but if for whatever reason VSCode focuses (by itself) on another tab, the modal will be buried under other tabs blocking UI interaction.

Not on topic, but: when working on multiple remotes, the manual reconnection routine is somewhat cumbersome, and this eluding modal just adds more pain. Overall, VSCode Remote can make reconnections flawless with a basic connectivity check before retrying and/or progressive backoff on each retry, as manually it takes couple minutes to flip thru all workspaces clicking reconnect button, sometimes several times in case a socket stuck or smth.

movy commented 7 months ago

Upon encountering this many more times, I figured the real culprit is that a VSCode workspace tab stealing focus upon reconnection, so if I have multiple remote workspaces open, focus will jump from one to another during reconnection stampede, and if one of workspaces fails to reconnect and brings up the modal, it will be buried under, in case another workspaces reconnects (hence pulling focus on itself), blocking the whole UI. I have only 4 remotes constantly open, and this thing happens at least 3-5 times a day (each time I switch wifi and VPN drops for example).

vscodenpa commented 3 months ago

Hey @deepak1556, this issue might need further attention.

@movy, you can help us out by closing this issue if the problem no longer exists, or adding more information.

movy commented 3 months ago

I confirm that this problem went away after one of recent updates, so I guess it has been fixed and can be closed for now.