-
Notifications
You must be signed in to change notification settings - Fork 189
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
Be nicer about where to open the results webview #1037
Conversation
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 wasn't sure how to review the actual code, but I tried opening webviews in various locations locally, and that worked as expected! 🕸️
Could you add a changelog entry for this PR?
Currently, the webview _always_ opens next to the currently active editor. This is a pain if you already have 2 columns open since this means that the webview will open in a third column, which is rarely what you want. This change uses a more sophisticated approach to opening the webview: 1. If there is only one column, open webview to the right of it 2. If there are multiple columns and the active editor is _not_ the last column, open to the right of the active editor 3. Otherwise open in the first column. This will avoid opening a new column unless there is only one column open right now. There is no native API that vscode exposed to compare column locations, so this uses the `ViewColumn` api is a slightly non-standard way. A limitation is that if the last column is empty and the active editor is to the left of it, then the webview will not be opened there (which would be nice). Instead, it will be opened in column 1.
58a4d3b
to
33420c0
Compare
@shati-patel can I get another look at this one? |
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.
Ooops sorry, I completely forgot to approve this 🙈
Thanks for the ping!!!
Currently, the webview always opens next to the currently active
editor. This is a pain if you already have 2 columns open since this
means that the webview will open in a third column, which is rarely
what you want.
This change uses a more sophisticated approach to opening the webview:
last column, open to the right of the active editor
This will avoid opening a new column unless there is only one column
open right now.
There is no native API that vscode exposed to compare column locations,
so this uses the
ViewColumn
api is a slightly non-standard way.A limitation is that if the last column is empty and the active editor
is to the left of it, then the webview will not be opened there (which
would be nice). Instead, it will be opened in column 1.
Checklist
@github/docs-content-codeql
has been cc'd in all issues for UI or other user-facing changes made by this pull request.