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

Support iframe based editors to reparent into floating windows #195715

Closed
bpasero opened this issue Oct 16, 2023 · 9 comments
Closed

Support iframe based editors to reparent into floating windows #195715

bpasero opened this issue Oct 16, 2023 · 9 comments
Assignees
Labels
custom-editors Custom editor API (webview based editors) feature-request Request for new features or functionality notebook on-testplan plan-item VS Code - planned item for upcoming webview Webview issues workbench-auxwindow Issues related to use of auxiliary ("floating") windows.
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Oct 16, 2023

With floating windows, users have the desire to move editors out of the main window into the child window. Some of our editors use an absolute positioned iframe element that is resized and moved to fit into the editor area it belongs to. This will not work anymore as soon as the editor moves out of the window.

I already made a pass and configured currently unsupported editors with the new AuxWindowUnsupported capability.

This impacts custom editors as well as notebooks.

Steps to move an editor out to a floating window:

  • remove the AuxWindowUnsupported capability for the editor of choice
  • open such an editor
  • trigger the "Move active editor into a new window" action from the command palette

//cc @Tyriar

@r3m0t
Copy link
Contributor

r3m0t commented Dec 9, 2023

Can I work on this one? My interest is in the notebook editor.

Is it possible to use DOM appendChild to move the iframe from one window to another?

Maybe retainContextWhenHidden: false is an easy case that can be done first? In this case the editor iframe can be safely destroyed and a new one created.

@bpasero
Copy link
Member Author

bpasero commented Dec 9, 2023

@r3m0t thanks for willing to chime in, I think @rebornix has already started on this so maybe he could comment

@r3m0t
Copy link
Contributor

r3m0t commented Dec 10, 2023

@bpasero
Copy link
Member Author

bpasero commented Dec 11, 2023

Thanks for asking, maybe #196148 or #196579. The others seem rather complex to me.

@abrahan-munro
Copy link

This issue is hard to find as it doesn't contain the text of the error message, so I'm adding that now:

This type of editor cannot be opened in other windows yet.

Also, an explicit list of windows that are affected would help with searching, e.g.

  • markdown preview
  • extensions

@rebornix rebornix modified the milestones: On Deck, December / January 2024 Dec 13, 2023
@rebornix
Copy link
Member

Is it possible to use DOM appendChild to move the iframe from one window to another?

@r3m0t thanks for offering help. Unfortunately we can't move/reparent iframe, it is always a re-create if we are moving the notebook editor to aux window. In addition to the challenge with iframe, we have a borrow-editor concept for notebook which needs to tweaked to get this working. I have a draft which I can send a PR for soon.

@jogibear9988
Copy link

But should the menu item to open in a new window be visible, even if it is not supported?

image

@bpasero
Copy link
Member Author

bpasero commented Feb 2, 2024

I think thats fine given we plan on actually resolving this issue this month.

@rebornix rebornix modified the milestones: February 2024, March 2024 Feb 21, 2024
@bpasero bpasero self-assigned this Feb 27, 2024
@bpasero bpasero added the plan-item VS Code - planned item for upcoming label Feb 27, 2024
@bpasero
Copy link
Member Author

bpasero commented Mar 14, 2024

Works now, minus bugs and limitations (dirty non-text based custom editors without backup cannot open in floating windows).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
custom-editors Custom editor API (webview based editors) feature-request Request for new features or functionality notebook on-testplan plan-item VS Code - planned item for upcoming webview Webview issues workbench-auxwindow Issues related to use of auxiliary ("floating") windows.
Projects
None yet
Development

No branches or pull requests

7 participants