Skip to content

[Controls Anywhere] Add variable controls when search session embeddable is added to Dashboard#242205

Merged
Heenawter merged 14 commits intoelastic:controlsAnywherefrom
Heenawter:fix-discover-sessions_2025-11-06
Nov 7, 2025
Merged

[Controls Anywhere] Add variable controls when search session embeddable is added to Dashboard#242205
Heenawter merged 14 commits intoelastic:controlsAnywherefrom
Heenawter:fix-discover-sessions_2025-11-06

Conversation

@Heenawter
Copy link
Copy Markdown
Contributor

@Heenawter Heenawter commented Nov 6, 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.

Part of #241678

Summary

This PR ensures that, when you are adding a Discover embeddable via the "Add from library" flyout, if that search session includes controls, these controls are added as panels alongside the Discover session embeddable.

Screen.Recording.2025-11-06.at.2.12.48.PM.mov

@Heenawter Heenawter added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort impact:critical This issue should be addressed immediately due to a critical level of impact on the product. Project:Controls labels Nov 6, 2025
@Heenawter Heenawter changed the title [Controls Anywhere] Fix Discover search sessions [Controls Anywhere] Fix Discover search session embeddables with variables Nov 6, 2025
@Heenawter Heenawter changed the title [Controls Anywhere] Fix Discover search session embeddables with variables [Controls Anywhere] Add variable controls when Discover search session is added to Dashboard Nov 6, 2025
// Only add controls whose variableName exists in current esqlVariables
Object.values(controlsState).forEach((panel) => {
// Only add controls whose variableName does not exist in current esqlVariables
for (const panel of Object.values(controlsState)) {
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.

I was running into placement issues if we didn't add these new panels sequentially (i.e. we wait for one panel to be fully added, including waiting for the child API to be available, before adding the next one). That is why you see a slight delay in adding the second variable in the video in the PR description. Not ideal, but 🤷

@Heenawter Heenawter added loe:small Small Level of Effort and removed loe:medium Medium Level of Effort labels Nov 6, 2025
Comment on lines +298 to +300
if (scrollToPanel) {
trackPanel.setScrollToPanelId(uuid);
}
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.

The screen would jitter when adding multiple panels. So we need the ability to turn it off when we know we are adding more than one panel in sequence.

@Heenawter Heenawter marked this pull request as ready for review November 6, 2025 21:36
@Heenawter Heenawter requested review from a team as code owners November 6, 2025 21:36
@Heenawter Heenawter removed the request for review from a team November 6, 2025 21:37
@Heenawter Heenawter changed the title [Controls Anywhere] Add variable controls when Discover search session is added to Dashboard [Controls Anywhere] Add variable controls when search session embeddable is added to Dashboard Nov 6, 2025
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.

Very cool! Nice work and a small & clean set of changes. Left one suggestion


export interface PublishesPauseFetch {
isFetchPaused$: Observable<boolean>;
setFetchPaused: (paused: boolean) => void;
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.

Can we separate this out into a different interface in the same file? IMO we shouldn't enforce that every API that pauses fetch can also have its fetch paused publicly.

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.

Can do 🫡

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.

Done in b5c75ee

@Heenawter Heenawter requested a review from a team as a code owner November 7, 2025 21:17
@Heenawter Heenawter merged commit 3b37c26 into elastic:controlsAnywhere Nov 7, 2025
7 of 10 checks passed
@Heenawter Heenawter deleted the fix-discover-sessions_2025-11-06 branch November 7, 2025 21:18
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Nov 7, 2025

💔 Build Failed

Failed CI Steps

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:critical This issue should be addressed immediately due to a critical level of impact on the product. loe:small Small Level of Effort 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.

4 participants