Skip to content

Wrap Panels in outer div? #163

@bollwyvl

Description

@bollwyvl

elevator pitch

Use existing upstream classes for the div that actually gets put into a DockPanel/StackPanel, and generally don't mess with it, and add the VBox as a child of it. Offer InstanceDict(Panel.panel_layout) for an escape hatch to modify this panel.

motivation

Presently, a Panel (or subclass) gets a lot of classes when added to various places, from both the host application (e.g. .jp-DockPanel-*) and from jupyter widgets (e.g. .widget-box). A number of these present layers of conflicting issues, which are likely not feasible to easily resolve without a lot of brittle !important. This becomes particularly apparent when trying to do a "full bleed" widget (no space) like a map or visualization

design ideas

  • Delegate much of Shell._add to a new subclass of a @lumino/widgets:* with a new class, e.g. jp-IpyPanel, which gets fully instantiated and added to the shell area before trying to resolve the DOMWidgetView
    • Panel is likely good, but there might be other choices
  • Add the view to the already-attached panel
  • If the comm gets closed, close the parent panel
  • As these appear to be "one shots" (e.g. once added, there is no low-level API for changing their parent), it might also make sense to explicitly name them with their area, and tweak some scoped css variables accordingly
    • e.g. for top area widgets, remove default vertical margin/padding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions