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

feat: Update panels from field change events #1925

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmingles
Copy link
Contributor

@bmingles bmingles commented Apr 5, 2024

resolves #1924

Comment on lines +347 to +352
const widgetContentItem = LayoutUtils.getContentItemInRoot(
layout.root,
{
title: toUpdate.title,
}
);
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be using the title here. The title changes when we clone panels and when we rename panels.

We should instead be matching by panelId (which we should already know if the panel was opened by AppMainContainer) or by the metadata. Problem is as you've identified below, ConsolePanel is doing a similar thing for panels that it has opened, so you can get conflicts.

Perhaps the panel/component itself should be listening for field updates, and update the widget if the underlying field changes (based somewhat on Raffi's comment that he would always want/expect the widget to reflect the currently named widget, indicating our behaviour when opening a panel and it not updating is incorrect).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea of the panel listening for changes and updating itself. I'll look into that.

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.

Opened panels should match the state of panels in the panels menu
2 participants