Skip to content

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

Closed
Zacqary wants to merge 11 commits intoelastic:controlsAnywherefrom
Zacqary:236021-control-focus-fix
Closed

[Controls Anywhere] Keep controls focused when creating + editing other panels#241023
Zacqary wants to merge 11 commits intoelastic:controlsAnywherefrom
Zacqary:236021-control-focus-fix

Conversation

@Zacqary
Copy link
Copy Markdown
Contributor

@Zacqary Zacqary commented Oct 28, 2025

Warning

This work is being merged into a feature branch, not main!
Because of this, we only need a review from @elastic/kibana-presentation for now.

Type failures are expected because the feature branch is currently in an incomplete state, where the controls that have not yet been converted are dependent on things that no longer exist.

Summary

Fixes #236021
Screenshot 2025-10-30 at 1 55 32 PM

This is a quick fix which just checks the panel type against defined control types, and prevents it from being blurred when another panel is in focus. I don't think we're planning to apply this non-blurring behavior to anything except controls, so I don't know if we need a more generic solution like passing isAlwaysInFocus into the panel.

If we're okay with tightly coupling control types to the dashboard renderer, this solution should work fine as-is.

When editing a panel, this PR will unblur any ES|QL controls that output any variables in the current panel's ES|QL query.

@Zacqary Zacqary requested a review from a team as a code owner October 28, 2025 17:39
@Zacqary Zacqary added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// Project:Controls labels Oct 28, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Zacqary and others added 4 commits October 30, 2025 12:11
…control-focus-fix

# Conflicts:
#	src/platform/plugins/shared/dashboard/public/dashboard_api/get_dashboard_api.ts
#	src/platform/plugins/shared/dashboard/public/dashboard_api/types.ts
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Oct 31, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@Zacqary Zacqary removed the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Oct 31, 2025
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Oct 31, 2025
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner October 31, 2025 17:24
@Zacqary Zacqary removed the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Nov 3, 2025
@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Nov 3, 2025
@Heenawter Heenawter removed request for a team November 3, 2025 22:39
@Zacqary Zacqary requested a review from Heenawter November 5, 2025 19:17
…/kibana into 236021-control-focus-fix

# Conflicts:
#	src/platform/plugins/shared/controls/public/controls/data_controls/options_list_control/get_options_list_control_factory.tsx
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 5, 2025

💔 Build Failed

Failed CI Steps

History

Copy link
Copy Markdown
Contributor

@Heenawter Heenawter Nov 5, 2025

Choose a reason for hiding this comment

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

This doesn't work when you are adding an existing control to an ES|QL query:

Screen.Recording.2025-11-05.at.3.21.32.PM.mov

But that is complicated, since we would somehow need to respond to the ES|QL query changing..... Unless there is an easy way to do that from within Dashboard, I am honestly starting to feel like we need to revisit this later with a different approach 🫠 A lot of more high-impact stuff has popped up since we started this.

Either that, or we just return to the simple approach of "all controls remain focused" 🤷

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.

Yeah I think we'd need to go into the ES|QL panel editor to make that possible.

@ThomThomson what do you think we should do here? Go back to keeping all controls in focus, or table this and keep pushing later?

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.

We talked offline - we will leave this until after the feature branch merges so that it can be done properly. Feel free fo close this or keep it open to revisit later @Zacqary :)

@baileycash-elastic baileycash-elastic removed the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Dec 4, 2025
@Heenawter Heenawter deleted the branch elastic:controlsAnywhere January 6, 2026 01:44
@Heenawter Heenawter closed this Jan 6, 2026
Zacqary added a commit that referenced this pull request Jan 9, 2026
…er panels (#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:


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
#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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Project:Controls Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants