Skip to content

Conversation

@Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Oct 14, 2025

Summary

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.

Closes #233037

Time slider as embeddable

Converts the time slider to an embeddable, allows it to be added as a panel that immediately pins itself and cannot be unpinned.
Screenshot 2025-10-14 at 5 01 19 PM

Known issues

The control does not highlight itself when added, tracked in #238981.

Conditionally enabled add panel action

This PR adds support for couldBecomeCompatible to the Add Panel menu. Actions that fail isCompatible but pass couldBecomeCompatible will be displayed as disabled menu items.

The time slider action is the only thing with an Add Panel trigger that implements couldBecomeCompatible, so this doesn't affect any existing actions.
Screenshot 2025-10-14 at 1 02 54 PM
Screenshot 2025-10-14 at 1 02 36 PM

Refactoring add panel menu to subscribe to compatibility changes

I did a rewrite of the way the Add Panel flyout renders the group menu. Before I did this, the Time Slider action would be disabled when you opened the menu, and then stay disabled if you deleted your existing Time Slider before closing the menu. This is because getMenuItemGroups was only fetching action compatibility once, and wasn't set up to re-render the menu if compatibility changed. The refactor I did enables this behavior to go smoothly:

enabledisable.mov

It's an edge case for sure, but if we add any new actions to the panel menu that take advantage of compatibility updates, we want them to work as expected.

@Zacqary Zacqary requested a review from a team as a code owner October 14, 2025 18:35
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Oct 14, 2025
@Zacqary Zacqary closed this Oct 14, 2025
@Zacqary Zacqary reopened this Oct 14, 2025
@Zacqary Zacqary marked this pull request as draft October 14, 2025 18:37
@Zacqary Zacqary added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// Project:Controls and removed Feature:Embedding Embedding content via iFrame labels Oct 14, 2025
@Heenawter
Copy link
Contributor

Heenawter commented Oct 14, 2025

The control is too narrow until we implement #234681.

FYI - time slider controls have never had the ability to edit the width and grow settings. So you should be able to add the time slider controls with size large and grow true without waiting for the attached issue - this will be identical to existing behaviour. The sizing should work as you expect as long as you set the values correctly.

@Zacqary Zacqary force-pushed the 233037-timeslider-embeddable branch from 3e57a9b to b9aa66b Compare October 14, 2025 21:35
@Zacqary Zacqary force-pushed the 233037-timeslider-embeddable branch from b9aa66b to 9fa97ca Compare October 14, 2025 21:39
@Zacqary
Copy link
Contributor Author

Zacqary commented Oct 14, 2025

@Heenawter I had to hard code the values in the layout manager for now, added a TODO comment so we know to remove when we implement real grow/width settings.

@Zacqary Zacqary marked this pull request as ready for review October 14, 2025 22:03
@elasticmachine
Copy link
Contributor

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

Copy link
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.

We are getting so close!! Found some more regressions that should be addressed before we merge this, unfortunately 🙇 We also still need to figure out the bundle size increase.

"page load bundle size" for "triggersActionsUi" is 1.2KB over the configured limit of 107.4KB

@Zacqary
Copy link
Contributor Author

Zacqary commented Oct 20, 2025

@Heenawter 1.2kb increase in triggersActionsUi is due to https://github.com/elastic/kibana/pull/238998/files#diff-ea642c87b2a563011a6799ad628dd55b44ede3129b5b03f79a2fa3859fd1b833R21-R28 in @kbn/presentation-publishing.

export interface AppliesTimeslice {
  appliedTimeslice$: PublishingSubject<[number, number] | undefined>;
}

export const apiAppliesTimeslice = (unknownApi: unknown): unknownApi is AppliesTimeslice => {
  return Boolean(unknownApi && (unknownApi as AppliesTimeslice)?.appliedTimeslice$ !== undefined);
};

Unfortunately we need to have this interface in a kbn package because both the controls and dashboard plugin need it. triggersActionsUi doesn't use it, but Kibana doesn't tree-shake correctly.

I can fix this by having the one thing in triggersActionsUi that imports a couple of type guards from presentation-publishing async import them, which, for the record, is terrible, and I hate it.

@Zacqary Zacqary requested a review from a team as a code owner October 20, 2025 17:51
@Zacqary Zacqary removed the request for review from a team October 20, 2025 17:54
Copy link
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.

Left one final nit but otherwise I think everything looks good 🎉 Thanks so much for your work on this one!

…r_control/get_timeslider_control_factory.tsx

Co-authored-by: Hannah Mudge <[email protected]>
@Zacqary Zacqary merged commit 391b56e into elastic:controlsAnywhere Oct 20, 2025
10 of 12 checks passed
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 20, 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

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