Skip to content
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

navigator: handle middle-click behavior #12783

Merged
merged 9 commits into from
Aug 3, 2023

Conversation

vladarama
Copy link
Contributor

@vladarama vladarama commented Jul 31, 2023

What it does

Fixes: #12762
Fixes: #12788

This PR handles the middle-click button behavior in various tree-widgets, such as the explorer, search-in-workspace, references ... Like in VS Code, selecting a file using the middle-button will open that file as an open-editor instead of simply selecting it. This achieves the same functionality as double-clicking on a file, but it is faster.

Demo:
middle-click demo

How to test

  1. Start Theia
  2. Open a Workspace / Folder
  3. Go to the Explorer / Search-in-workspace / SCM /... views
  4. Select a file by pressing the mouse's middle button (scroll wheel)
  5. The file should be selected and added as an open-editor

Review checklist

Reminder for reviewers

@msujew msujew added the navigator issues related to the navigator/explorer label Jul 31, 2023
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I noticed a bug when opening multiple editors using middle-click where we would incorrectly paste the clipboard into the editor (Linux):

  1. start the application
  2. confirm that content exists in the clipboard
  3. open multiple editors from the explorer using middle-click
  4. confirm the bug exists where clipboard content is being pasted into previous editors

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I confirmed that the changes work as expected 👍

  • middle-click in the explorer, and other trees (ex: siw) works as expected
  • middle-clicking collapsible nodes correctly expands/collapses nodes
  • the auto-scroll behavior was fixed (confirmed on Firefox)

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Works well for me as well 👍

@vince-fugnitto
Copy link
Member

I'll merge, we can catch any potential regressions throughout the month if necessary.

@vince-fugnitto vince-fugnitto merged commit a9ffaa4 into eclipse-theia:master Aug 3, 2023
6 checks passed
@vince-fugnitto vince-fugnitto added this to the 1.41.0 milestone Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
navigator issues related to the navigator/explorer
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

tree: mouse's middle-button enables auto-scrolling on Windows explorer: middle click does not open a file
3 participants