Skip to content

fix: DH-21257: Check if panel parent is in root when opening#1366

Merged
mofojed merged 6 commits into
deephaven:mainfrom
dgodinez-dh:dag_AddParentToRoot
Jun 17, 2026
Merged

fix: DH-21257: Check if panel parent is in root when opening#1366
mofojed merged 6 commits into
deephaven:mainfrom
dgodinez-dh:dag_AddParentToRoot

Conversation

@dgodinez-dh

Copy link
Copy Markdown
Contributor

When opening a panel, check if the parent has been removed from root. If it has, add it back to the layout root so that the panel will appear somewhere in the layout.

@dgodinez-dh dgodinez-dh requested a review from mofojed June 16, 2026 19:49
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

const rootChild =
root.contentItems.length > 0 ? root.contentItems[0] : root;
rootChild.addChild(parent);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. a couple odd things when doing it like this:

  1. The row layout is still lost (all the panels are stacked in one column instead of across like in a row)
  2. The stack header for the last item does not seem to appear
Image

The row layout not being respected is kind of "well we're trying our best", but the stack header not appearing seems to be a bug (you can't drag to move that item anymore... though it does re-appear if you drag another panel...).

Right now we're just adding the parent if it's not attached; but I'm wondering if we should be re-adding the top most parent that isn't attached. A bit of a complication is that we would need to ensure it doesn't contain containers that have already been moved to somewhere else before re-attaching ... but I think would ultimately be more correct, and fix that header case. See if that's possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to add top most parent. This also fixed the header issue.

@dgodinez-dh dgodinez-dh requested a review from mofojed June 17, 2026 13:29
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@mofojed mofojed left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this behaviour better, seems to be the best we can do. Note that it's still a bit weird if you go down to 1 panel, then to 5 (new row added), then down to 2 panels, then to 5 again (new row added), but that's the way it is.

Looks like you might need to fix some tests.

@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@mofojed mofojed merged commit 3ac48fb into deephaven:main Jun 17, 2026
23 checks passed
@dgodinez-dh dgodinez-dh deleted the dag_AddParentToRoot branch June 17, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants