[Controls Anywhere] Keep controls focused when creating + editing other panels#248021
[Controls Anywhere] Keep controls focused when creating + editing other panels#248021Zacqary merged 15 commits intoelastic:mainfrom
Conversation
...atform/packages/shared/presentation/presentation_containers/interfaces/panel_capabilities.ts
Outdated
Show resolved
Hide resolved
...atform/packages/shared/presentation/presentation_containers/interfaces/panel_capabilities.ts
Outdated
Show resolved
Hide resolved
This reverts commit 91e9899. # Conflicts: # src/platform/plugins/shared/controls/public/controls/data_controls/data_control_manager.ts # src/platform/plugins/shared/controls/public/controls/esql_control/esql_control_manager.ts # src/platform/plugins/shared/dashboard/public/dashboard_api/related_panels_manager.ts
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
ThomThomson
left a comment
There was a problem hiding this comment.
Nice well tested and commented new API for Dashboards, which follows all of our standards!
My only hesitation is how much it pushes the logic for determining when panels are related via ESQL variables onto the Dashboard instead of keeping it at the Lens level.
That said, I see why you've done it this way. The Dashboard is the best place for this logic for controls, so keeping the ESQL logic here too centralizes it nicely. Additionally, the relationship to ESQL is nicely encapsulated by the apiPublishesESQLQuery call and the getESQLQueryVariables call.
Overall no blockers in the code, and everything worked correctly when testing locally, I like that you can drag the controls around while editing a panel, and that if you drag them into a section that doesn't apply them immediately become unfocused. Nice attention to detail! LGTM
| const blurPanel = | ||
| focusedPanelId !== undefined && | ||
| focusedPanelId !== id && | ||
| !arePanelsRelated(id, focusedPanelId); |
There was a problem hiding this comment.
Nice clean usage of the new API
Heenawter
left a comment
There was a problem hiding this comment.
I left a couple code nits but Kibana is being annoying so I can't test it before I take off for the day. Trusting Devon's testing of the behaviour + the code LGTM 🎉
src/platform/plugins/shared/dashboard/public/dashboard_api/related_panels_manager.ts
Show resolved
Hide resolved
src/platform/plugins/shared/dashboard/public/dashboard_api/related_panels_manager.ts
Outdated
Show resolved
Hide resolved
…ated_panels_manager.ts Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Unknown metric groupsAPI count
History
|
…er panels (elastic#248021) ## Summary Closes elastic#236021 (Second pass at this issue after elastic#241023 was closed, previous discussions may contain some helpful context.) Focuses filter controls that apply to the same section as the focused panel: https://github.com/user-attachments/assets/2eedfd2f-ef73-4afb-88e9-839cd32e8ad9 Also focuses ES|QL controls which affect the currently focused ES|QL panel, including controls that have just been created: https://github.com/user-attachments/assets/09d68f3d-cd03-4d91-82e6-ef6b95a69d48 I opted NOT to check whether ES|QL panels and ES|QL controls were in the same section, because it shouldn't be possible to use an ES|QL variable that's unavailable in a certain panel's section. It is currently possible to do this, but once elastic#248198 is fixed we shouldn't need any special section checking logic for ES|QL. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
* commit 'c4304e27736c62f17af20d145770b2ae9d3fae30': (418 commits) skip failing suite (elastic#89079) [ES|QL] Update grammars (elastic#248600) skip failing test suite (elastic#248579) [ES|QL] Update function metadata (elastic#248601) skip failing test suite (elastic#248554) Fix flaky test runner serverless flag for Search solution (elastic#248559) [Security Solution][Attacks/Alerts][Attacks page][Table section] Remember last selected attack details tab (Summary or Alerts) (elastic#247519) (elastic#247988) Fix ES health check poller (elastic#248496) Fix collector schema ownership (elastic#241292) [api-docs] 2026-01-10 Daily api_docs build (elastic#248574) Update dependency cssstyle to v5.3.5 (main) (elastic#237637) Update dependency @octokit/rest to v22.0.1 (main) (elastic#243102) skip failing test suite (elastic#248504) skip failing test suite (elastic#247685) Remove broken ecommerce_dashboard journeys (elastic#248162) [Obs AI] Hide AI Insight component when there are no connectors (elastic#248542) skip failing suite (elastic#248433) [Security Solution][Attacks/Alerts][Attacks page][Table section] Hide tabs for generic attack groups (elastic#248444) [Agent Builder] [AI Infra] Adds product documentation tool and task evals (elastic#248370) [Controls Anywhere] Keep controls focused when creating + editing other panels (elastic#248021) ...
Summary
Closes #236021 (Second pass at this issue after #241023 was closed, previous discussions may contain some helpful context.)
Focuses filter controls that apply to the same section as the focused panel:
Screen.Recording.2026-01-08.at.4.28.57.PM.mov
Also focuses ES|QL controls which affect the currently focused ES|QL panel, including controls that have just been created:
Screen.Recording.2026-01-08.at.4.31.53.PM.mov
I opted NOT to check whether ES|QL panels and ES|QL controls were in the same section, because it shouldn't be possible to use an ES|QL variable that's unavailable in a certain panel's section. It is currently possible to do this, but once #248198 is fixed we shouldn't need any special section checking logic for ES|QL.
Checklist