-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify the server status item click action #3537
Conversation
Signed-off-by: Sheng Chen <[email protected]>
I'm seeing some odd behaviour with this change. The server status terminal view does get focus upon clicking, but the quick-pick also immediately disappears. It seems to me like the act of showing the server status closes the already opened quick-pick since the |
Signed-off-by: Sheng Chen <[email protected]>
Ah, good catch! I tried first adding the Then I went to the current solution that adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks fine and works well. I found one minor thing so if it can be addressed, feel free to do so. If not, I'm also fine to squash+merge.
const choice = await window.showQuickPick(items); | ||
const choice = await window.showQuickPick(items, { | ||
ignoreFocusOut: true, | ||
placeHolder: "Press 'ESC' to close." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true in the default case, but it's just controlled by workbench.action.closeQuickOpen
which has keyboard shortcuts. So technically someone could change that option (for eg. make it shift+esc) and esc would no longer work.
Does VS Code have API to get the main keyboard shortcut currently represented by some command ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found this answer: microsoft/vscode-discussions#780
Looks like there is no command but we can inspect the json file to check if user sets other keybindings.
I tend to keep the current simple implementation, but at least, we know there is a solution if we have to address it in the future.
I can definitely confirm (at least on Linux) that the first activation of the server status bar (mouse click), followed by usage of the arrow keys to navigate the quick-pick works. However, upon activating it a second time (mouse click), the arrow keys have no effect, as the quick-pick does not appear to have focus. |
This PR simplifies the actions when click the server status bar item. The item for the server status is removed. Instead, when clicking on the server status, it will directly open the build job terminal, and show the shortcut dropdown at the meantime.