-
Notifications
You must be signed in to change notification settings - Fork 92
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
viewer: bring focus to editor if it already exists #5631
Conversation
Addresses #5527 |
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.
Works great! 🙌
I understand that this only applies to one open in the Viewer pane, and that additional instances of the Viewer pane being opened will open a new editor tab. I don't think we need to fix this now. Would you open a followup issue on that, after this gets merged?
When I open HTML in the editor tab, it get the little eye icon for the command "Open in Viewer". If I click on that (which is a bit silly, given that it is already open in the Viewer), I see the error:
Check dependency list! Synchronous require cannot resolve module 'path'. This is the first mention of this module!
Is it possible to do something low lift to resolve this? Like only apply the command to HTML in source mode? It would be fine for this to be a followup PR, or to open an issue for it and send it to triage if it is not straightforward to solve currently.
Correct. IMO, it seems like we would want the ideal behavior to be pretty close to what we have now; that is, we would want to be able to have multiple different editor tabs from the Viewer (eg, multiple rendered quarto documents). What is missing for multiple-editor-tabs is the ability to track if an editor is populated from a Viewer pane that was closed and then reopened--which I can open an issue for once this is merged!
Let me check out turning this off! FWIW: I am seeing this error even for source HTML files, and the popped out editor tabs |
@@ -22,14 +22,14 @@ | |||
"menus": { | |||
"explorer/context": [ | |||
{ | |||
"when": "resourceLangId == html", | |||
"when": "resourceLangId == html && resourceScheme == file", |
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.
since the tab is technically not "looking at a file", this allows source html to keep the eye icon to open in viewer, but it should not show up at all for viewer->editor tabs!
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.
Works great!
This looks good 🎉 . I'm likely going into extreme edge case scenario over here... What should happen in a "split" editor situation? (see vid) Screen.Recording.2024-12-05.at.3.55.14.PM.mov |
Split editors do work well for the Data Explorer and Plots in an editor tab. Is it doable to get them working for Viewer tabs as well? |
I'm almost certain the split editor is related to #5500, as both are issues with moving the webview overlay. I'll fix that in a followup PR! |
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.
Sounds good! Thank you so much 🚀
Previously, a new editor pane populated each time you opened it from the Viewer.
Note: if you
it WILL open a new tab since the url to open HTML files is regenerated each time. I thought about using the file name instead, but it does not include directories, eg,
index.html
andfiles/index.html
would be considered identical. I can look into something more elegant if we want to handle for the above situation, but I'm not sure how often it will happen/if this behaviour is actually desired.QA Notes
Clicking
Open the content in an editor pane.
multiple times will bring focus to opened tab rather than opening new ones.