jupyterlab/lumino

Dock panels that have dock panels inside become very difficult/impossible to rearrange

drcd1 opened this issue · 3 comments

drcd1 commented

Description

When using DockPanels inside a DockPanel, with the 'tabsConstrained' option, it is very difficult to re-organize the top level's layout.
This issue is related to #43 . While #43 was solved by blocking invalid moves and drags, it doesn't show the "valid" possible moves. Below you can see an animation reproducing this issue.

Animation

Here, the user tries to move panel 2 under panel 3. Most of the overlay positions are blocked, because the lower level dockpanels take priority. The user then is able to place panel 3 at the very very thin margins. This (correctly) does not yield the intended layout, and then the original configuration becomes impossible to recover, as the user is only able to place the panels at the margins: all other positions are blocked.

Reproduce

  1. Create a ui interface with DockPanels inside DockPanels. Don't forget to set 'constrainedTabs' so that the panels
  2. Attempt to drag one of the top level tabs to reorganize the top level layout.
  3. Notice how this is almost impossible to do, as the 'drag' only sees the bottom layer, and (correctly) marks the move as invalid.

Expected behavior

When dragging a top-level tab in a DockPanel, one would expect to see the overlays and act changes only for the top level, and not have their actions interpreted as if they wanted to place the tabs inside the inner DockPanel.

Proposed solution

When handling drag events in the DockPanel, don't stop propagation if they're invalid.
I've tested this and it seems to work.
I will make a pull request with these changes

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

drcd1 commented

Here's a modified version of one of the examples that illustrates the problem:
example-dockpanel-amd.zip

Closing as fixed by #473