-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Dont scroll to revealed files option. #96890
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
Conversation
Adds a new option in settings to not scroll to revealed files in the file explorer view.
| }, | ||
| 'explorer.autoRevealNoScroll': { | ||
| 'type': 'boolean', | ||
| 'description': nls.localize('autoRevealNoScroll', "Controls whether the explorer should not automatically scroll to revealed files."), |
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.
Please chagne to "should automatically" the word "not" makes the sentence more confusing
| 'description': nls.localize('autoReveal', "Controls whether the explorer should automatically reveal and select files when opening them."), | ||
| 'default': true | ||
| }, | ||
| 'explorer.autoRevealNoScroll': { |
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.
explorer.autoRevealScroll is a better name
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.
What about explorer.autoScrollOnReveal ?
As an end user that tells me exactly what's happening without even having to read the description.
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.
autoScrollOnReveal also highlights the dependency on autoReveal which you referenced here @phuein #96890 (comment)
|
@phuein thank you for the PR. However I am not 100% convinced we need this. The deafult behavior imho is fine
What is the case that does not work for you. |
autoRevealNoScroll -> autoRevealScroll with a matching description and default value to true, the editor's default behavior.
|
Hi @isidorn, thanks for reviewing my PR. I've modified the name and description to fit your suggestions. I agree it's less verbose and confusing this way. I ran a search for The case that bothers users is two-fold, and made us disable
|
|
Thanks for updating the PR and for claryfing.
|
|
@isidorn have you read the original description? It is pretty detailed, this feels like a repeat discussion. We just want to see the active file highlighted like normal in the sidebar, without the sidebar scrolling on us when our active file changes. |
| }, | ||
| 'explorer.autoRevealScroll': { | ||
| 'type': 'boolean', | ||
| 'description': nls.localize('autoRevealScroll', "Controls whether the explorer should automatically scroll to revealed files."), |
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.
Perhaps -
Controls whether the explorer should automatically scroll when a different file is selected
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.
autoRevealScroll depends on autoReveal being active, so I feel the current description fits better.
|
For both 1 and 2, this issue only refers to when the file is not visible in the explorer view, and so causing an unwanted scroll. With this in mind, my previous post explains scenarios where this scrolling may be unwanted. Video example of scrolling scenario: |
|
@phuein so why don't you disable autoReveal? Because you want autoReval only when the item is in the viewport? |
Because if you disable autoReveal, then Explorer does not correctly highlight the active file. It permanently keeps the highlight on the last file the user selected in explorer. That is, until the user explicitly clicks on a different file in Explorer. |
|
@isidorn here are two usecases where the current behavior is very frustrating: Usecase 1
That is incredibly annoying as a user. It takes you completely out of flow. However, I still want to see the active file highlighted (just not scrolled to) because that behavior is very useful. Usecase 2Another usecase would be exploring down the sidebar and wanting to switch between viewing files you're exploring in the sidebar, as well as already-open tabs -- without VS Code forcing you to lose your place because the files aren't in the same part of the folder hierarchy. Ref #23902 (comment) |
|
Ok thanks for the explanation. Idealy we would change the |
autoRevealScroll removed, AutoReveal class added with string options, and maintained backwards boolean value compatibility.
|
I'm glad the issue and user needs are clarified. I also agree that the previous added setting was funky. I went with it as a simple concept. Modifying autoReveal added complexity. Especially with being boolean backwards compatible. It's now changed and implemented with the new commit. Thanks for reviewing my work. |
|
Thanks for the changes. However there is one problem, now when users who have explorer.autoReveal: true or false will see a warning when they open their settings.json Apart from that:
|
Also fix types for setting variable type error.
|
Alright, this commit should simplify it. It's either true / false / [string]. Less files and lines are affected. Also fixed the type error for the setting variable. And removed the excess console.log(). |
| 'type': ['boolean', 'string'], | ||
| 'enum': [true, false, 'highlightNoScroll'], | ||
| 'default': 'autoReveal.on', | ||
| 'enumDescriptions': [ |
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.
I think this enum descriptions and the default are wrong. Default should be true.
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.
Nice catch, I missed that line. Committed again.
|
Good job, thanks for this PR. Merging in ☀️ 🍺 |
|
Pushed a bit of polish via a06c753 |
|
Awesome! Thanks for helping out throughout the PR. Everything should be checked now, and I can't wait to enjoy this on release. |
|
Thanks for contributing! |


Adds a new option in settings to not scroll to revealed files in the file explorer view.
This PR fixes #23902
Quick demo: https://drive.google.com/file/d/1k_RL401kYfRgdfC1nVHkyPI65BSL-oXL/view?usp=sharing