Skip to content

[Controls Anywhere] Keep controls focused when creating + editing other panels#248021

Merged
Zacqary merged 15 commits intoelastic:mainfrom
Zacqary:236021-focus-controls
Jan 9, 2026
Merged

[Controls Anywhere] Keep controls focused when creating + editing other panels#248021
Zacqary merged 15 commits intoelastic:mainfrom
Zacqary:236021-focus-controls

Conversation

@Zacqary
Copy link
Copy Markdown
Contributor

@Zacqary Zacqary commented Jan 6, 2026

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

@Zacqary Zacqary added Feature:Dashboard Dashboard related features Feature:Input Control Input controls visualization Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. labels Jan 6, 2026
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
@Zacqary Zacqary marked this pull request as ready for review January 8, 2026 22:39
@Zacqary Zacqary requested a review from a team as a code owner January 8, 2026 22:39
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@Zacqary Zacqary added backport:version Backport to applied version labels v9.4.0 labels Jan 8, 2026
@Zacqary Zacqary removed the impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. label Jan 8, 2026
@Zacqary Zacqary added the impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. label Jan 8, 2026
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

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);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice clean usage of the new API

Copy link
Copy Markdown
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

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 🎉

…ated_panels_manager.ts

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
@Zacqary Zacqary enabled auto-merge (squash) January 9, 2026 19:34
@Zacqary Zacqary merged commit 7c776cf into elastic:main Jan 9, 2026
13 checks passed
@kibanamachine kibanamachine added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Jan 9, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #50 / Cloud Security Posture Security Network Page - Graph visualization ECS fields only expanded flyout - entity enrichment for multiple actors and targets

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 1020 1021 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/presentation-publishing 257 261 +4
dashboard 112 113 +1
total +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 784.7KB 787.1KB +2.4KB
Unknown metric groups

API count

id before after diff
@kbn/presentation-publishing 303 307 +4
dashboard 114 115 +1
total +5

History

devamanv pushed a commit to devamanv/kibana that referenced this pull request Jan 12, 2026
…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>
mbondyra added a commit to mbondyra/kibana that referenced this pull request Jan 12, 2026
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Dashboard Dashboard related features Feature:Input Control Input controls visualization impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Controls Anywhere] Keep controls focused when creating + editing other panels

5 participants