Skip to content

Support iframe based editors to reparent into floating windows #195715

Closed

Description

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 Daniel Imms (@Tyriar)

Activity

  1. added
    feature-request
    webview
    workbench-auxwindow
    on Oct 16, 2023
  2. r3m0t commented on Dec 9, 2023

    @r3m0t
    Contributor

    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.

  3. bpasero commented on Dec 9, 2023

    @bpasero
    ContributorAuthor

    Tomer Chachamu (@r3m0t) thanks for willing to chime in, I think Peng Lyu (@rebornix) has already started on this so maybe he could comment

  4. bpasero commented on Dec 11, 2023

    @bpasero
    ContributorAuthor

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

  5. abrahan-munro commented on Dec 13, 2023

    @abrahan-munro

    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
  6. modified the milestones: On Deck, on Dec 13, 2023
  7. rebornix commented on Dec 13, 2023

    @rebornix
    Contributor

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

    Tomer Chachamu (@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.

  8. modified the milestones: , February 2024 on Jan 22, 2024
  9. jogibear9988 commented on Feb 2, 2024

    @jogibear9988
    Contributor

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

    image
  10. bpasero commented on Feb 2, 2024

    @bpasero
    ContributorAuthor

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

  11. added
    plan-item
    on Feb 27, 2024
  12. bpasero commented on Mar 14, 2024

    @bpasero
    ContributorAuthor

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

  13. added
    custom-editors
    on Mar 14, 2024
  14. locked and limited conversation to collaborators on Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

custom-editorsfeature-requestnotebookon-testplanplan-itemwebviewworkbench-auxwindow

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions