-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
force preview editor on quick search navigation #205137
Conversation
I'm worried that if a user already specified that they want preview off, that they might actually want all the results to remain. There are also several enable preview settings, so I wonder whether using or creating a setting like that could work instead. |
That's true. Thoughts @bpasero @TylerLeonhardt ? I know there's a setting for quick open- I wonder if we could follow that or create a new setting? But at the same time, many settings might get confusing. |
I've requested Ben's review on this just to prevent a random review from occurring. Adding something to the core editor type is always a big change. I'm surprised there's not an editor option that can accomplish what we're looking for here. |
After talking to Logan about this, he suggested that we just change |
Yeah I like the idea of One thing to keep in mind is that if a user has disabled preview editors, we should make sure that no preview editors stick around after leaving quick search. |
I already made sure that there were no preview editors on |
Yeah I think if the picker closes its a good moment to reset any preview state. But that is also the time to restore the previous UI state, so I guess its all part of it anyway. |
I made the argument Also, I created #205236 to track making sure that all preview editors are closed after using quick search. |
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 just had an idea how to do this alternatively: we allow to temporarily override user settings via IEditorGroupService.mainPart.enforcePartOptions
. It returns a IDisposable
to clean up when done and allows you to enforce options such as enablePreview: true
. I think it would even take care of removing any preview state once you dispose it. Can you see if that works? Sorry I only figured this out now...
I don't think that that would work in my case, because once I dispose the
every time I want to open an editor, but this turns into
|
Are we able to detect this case and dispose the enforced editor part options? And then are we able to detect that focus goes back to the picker to enforce it again? If so, I am not too worried about that behaviour. You could argue that if the user leaves the picker open, the user might want to actually use the editor that was opened as preview and then making it non-preview seems OK to me. I am a bit sceptical about the current approach here forcing everyone that deals with editor options to use the new utility method, so I was hoping for a simpler change. |
I have created a 'layered' disposable that where a 'local' disposable will drive turning on/off enablePreview and the global on/off will actually stop the trigger of "onDidChangeEditorPartOptions" when enabled. So then the process looks more like
|
35004af
to
fba242a
Compare
Closing in favour of: #205530 |
Fixes #205136
Related to #204853
cc @bpasero