Skip to content

Terminal Tabs: disable dragging and clicking during renaming#166821

Merged
Tyriar merged 2 commits intomicrosoft:mainfrom
pzhlkj6612:terminalTabsList-rename-disable-click-and-drag
Dec 13, 2022
Merged

Terminal Tabs: disable dragging and clicking during renaming#166821
Tyriar merged 2 commits intomicrosoft:mainfrom
pzhlkj6612:terminalTabsList-rename-disable-click-and-drag

Conversation

@pzhlkj6612
Copy link
Copy Markdown
Contributor

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

  1. In "Settings", set the value of "Terminal > Integrated > Tabs: Focus Mode" to "singleClick".
  2. Create multiple terminals to make the tab list appear.
  3. Enter "tab name editing mode". Right-click the tab, then click "Rename...".
  4. Try to single-click the inputbox.
  5. Try re-entering "tab name editing mode". Press and hold down the mouse button on the tab, then type F2 and release the mouse button.

Common steps for following sections

  1. In "Settings", set the value of "Terminal > Integrated > Tabs: Focus Mode" to "doubleClick".
  2. Create multiple terminals to make the tab list appear.
  3. Enter "tab name editing mode". Select the tab, then type F2 or use the right-click context menu.

Selection & Draging and Dropping (DnD)

  1. Try selecting the text in the inputbox. Press and hold down the mouse button and move the cursor.
  2. Select the text by keyboard.
  3. Try move the selection. Drag the selection to a different location and drop it.

Focus on a terminal box by double-click

  1. Try selecting a word by double-clicking it in the inputbox.

Spawn a new terminal in a group with the current one

  1. Try holding the ALT key and single-clicking the inputbox.

EOF

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".
Copy link
Copy Markdown
Collaborator

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍🏼 aligns with the explorer

@meganrogge meganrogge requested a review from Tyriar December 13, 2022 17:31
@meganrogge meganrogge added feature-request Request for new features or functionality verification-needed Verification of issue is requested labels Dec 13, 2022
@Tyriar Tyriar merged commit 586cb87 into microsoft:main Dec 13, 2022
@Tyriar Tyriar removed feature-request Request for new features or functionality verification-needed Verification of issue is requested labels Jan 23, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants