Skip to content

[Controls Anywhere] Add UI for grow and width settings to sticky controls#240149

Merged
Zacqary merged 18 commits intoelastic:controlsAnywherefrom
Zacqary:234681-controls-display-settings
Oct 27, 2025
Merged

[Controls Anywhere] Add UI for grow and width settings to sticky controls#240149
Zacqary merged 18 commits intoelastic:controlsAnywherefrom
Zacqary:234681-controls-display-settings

Conversation

@Zacqary
Copy link
Copy Markdown
Contributor

@Zacqary Zacqary commented Oct 22, 2025

Summary

Closes #234681

controlwidth.mov
  • Adds a DisplaySettingsPopover element to the control panel, and anchors it to the left hand side drag handle/title label. This popover is not triggered by clicking its anchor
  • Opens the popover when the user clicks the new Settings hover action, which is only compatible with pinned controls

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

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

"unifiedSearch",
"uiActions"
"uiActions",
"kibanaReact"
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.

Editing floating_actions.tsx without this present started throwing errors about kibanaReact being missing, because the controls renderer package imports useKibana. Not sure why this is suddenly being enforced, but I had to add this to get it to build.

@Heenawter
Copy link
Copy Markdown
Contributor

Oh!! I guess I totally misunderstood what the fix for the jumping popover was going to be. I thought we were trying to move the actual gear icon, not just the anchor of the popover. @ThomThomson Is the video in the PR description inline with what you were thinking? It feels strange to me that a popover would not be attached to the action that triggered it, but 🤷 This is a good low-effort solution for the jumping possibly?

@ThomThomson
Copy link
Copy Markdown
Contributor

@Heenawter yes this is exactly what I was intending from the fix. I agree it is a little weird having the popover not attached to the hover action that caused it, but I think it's a pretty small drawback.

Unrelatedly, we might consider calling Settings something more specific, like Width.

This reverts commit ecd69a3.

# Conflicts:
#	src/platform/packages/private/kbn-controls-renderer/src/components/floating_actions.tsx
@Zacqary
Copy link
Copy Markdown
Contributor Author

Zacqary commented Oct 22, 2025

newline.mov

One remaining question is what to do about the popover when changing the width setting moves the control to a new line, e.g. it's next to two controls with min widths of large.

I don't see an obvious solution here. Should we call this good enough or try and come up with something?

@Zacqary
Copy link
Copy Markdown
Contributor Author

Zacqary commented Oct 22, 2025

@ThomThomson Renamed Settings to Width though I don't love the gear icon for that name. Any better options? expand has some connotations on dashboard already so I don't think it works either.


constructor() {}

public readonly MenuItem = ({ context }: { context: EmbeddableApiContext }) => {
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.

In the past, we put the component in a separate file - see src/platform/plugins/shared/dashboard/public/dashboard_actions/filters_notification_action.tsx. It helps keep the action code simpler and easier to follow IMO. What do you think @Zacqary?

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.

I actually don't mind this all being in one file TBH. We try to keep files under 300ish lines, and IMO if there at or around this limit, breaking them into multiple files isn't really worth the overhead.

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.

Welp I already moved it, whoops

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.

Is it worth reverting @ThomThomson or should I just merge as-is?

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Oct 27, 2025

💔 Build Failed

Failed CI Steps

History

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.

Everything LGTM!! 🎉

@Zacqary Zacqary merged commit c8517cf into elastic:controlsAnywhere Oct 27, 2025
10 of 12 checks passed
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.

5 participants