Terminal Tabs: disable dragging and clicking during renaming#166821
Merged
Tyriar merged 2 commits intomicrosoft:mainfrom Dec 13, 2022
pzhlkj6612:terminalTabsList-rename-disable-click-and-drag
Merged
Terminal Tabs: disable dragging and clicking during renaming#166821Tyriar merged 2 commits intomicrosoft:mainfrom pzhlkj6612:terminalTabsList-rename-disable-click-and-drag
Tyriar merged 2 commits intomicrosoft:mainfrom
pzhlkj6612:terminalTabsList-rename-disable-click-and-drag
Conversation
By reading "ui/list/listView.ts" we know that whether the tab can be dragged (domNode.draggable) depends on the "drag URI". When editing the name of a terminal tab, a "falsy" URI should be returned to make the tab undraggable. Single-click and double-click make terminalTabsList perform some actions (spawning new terminal in a group, focusing on a terminal box, etc), but it should not happen when the tab is being renamed. I learned above from "WatchExpressionsDragAndDrop::getDragURI()" and "WatchExpressionsView::onMouseDblClick()" in "debug/browser/watchExpressionsView.ts".
meganrogge
approved these changes
Dec 13, 2022
Tyriar
approved these changes
Dec 13, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
Commit message
By reading "ui/list/listView.ts" we know that whether the tab can be dragged (
domNode.draggable) depends on the "drag URI". When editing the name of a terminal tab, a "falsy" URI should be returned to make the tab undraggable.Single-click and double-click make terminalTabsList perform some actions (spawning new terminal in a group, focusing on a terminal box, etc), but it should not happen when the tab is being renamed.
I learned above from "
WatchExpressionsDragAndDrop::getDragURI()" and "WatchExpressionsView::onMouseDblClick()" in "debug/browser/watchExpressionsView.ts".Related Issues
Did not found, yet.
Screen Recording
Filename: 20221120-vscode-terminalTabsList-ScreenRecording-nay-1.mp4
20221120-vscode-terminalTabsList-ScreenRecording-nay-1.mp4
Filename: 20221120-vscode-terminalTabsList-ScreenRecording-yea-1.mp4
20221120-vscode-terminalTabsList-ScreenRecording-yea-1.mp4
The above videos are recorded by OBS Studio and edited with Kdenlive; the overlay of input of mouse and keyboard is from the univrsal/input-overlay plugin. Thanks to Open Source.
How to test
There seems to be no unit tests covering this change, so we may have to test it manually. The steps are as follows.
Here I'm assuming that both "single-clicks" and "double-clicks" are "left-button clicks".
Special: focus on a terminal box by single-click
F2and release the mouse button.Common steps for following sections
F2or use the right-click context menu.Selection & Draging and Dropping (DnD)
Focus on a terminal box by double-click
Spawn a new terminal in a group with the current one
ALTkey and single-clicking the inputbox.EOF