Skip to content

Comments

[Controls] Fix disabled range slider tooltip, clean up delete control button#227295

Merged
Zacqary merged 3 commits intoelastic:mainfrom
Zacqary:data-control-editor-papercuts
Jul 9, 2025
Merged

[Controls] Fix disabled range slider tooltip, clean up delete control button#227295
Zacqary merged 3 commits intoelastic:mainfrom
Zacqary:data-control-editor-papercuts

Conversation

@Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Jul 9, 2025

Summary

Fix tooltip for disabled range slider

When selecting a non-numerical field, the range slider was disabled with this tooltip:

Screenshot 2025-07-09 at 11 04 46 AM

Looking at the error message code, this was not the intended behavior:

/** This shouldn't ever happen - but, adding just in case as a fallback. */
return i18n.translate(
  'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',
  {
    defaultMessage: 'Select a compatible control type.',
  }
);

This PR fixes this logic so the correct message is displayed:
Screenshot 2025-07-09 at 11 04 14 AM

Move delete control button to flyout footer and add confirm dialog

When editing a control, a Delete Control button would appear here in the flyout body, which is hard to spot if the screen height is small and the user has to scroll down:

Screenshot 2025-07-09 at 11 22 23 AM

Clicking this button would also just immediately delete the control, and failed to display this confirmation modal:
Screenshot 2025-07-09 at 11 21 36 AM

This PR adds the confirmation modal when trying to delete a control from the edit flyout, and also moves the button to the flyout footer:
Screenshot 2025-07-09 at 11 21 22 AM

@Zacqary Zacqary requested a review from a team as a code owner July 9, 2025 16:31
@Zacqary Zacqary added Feature:Dashboard Dashboard related features release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:small Small Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Project:Controls backport:version Backport to applied version labels v9.1.0 v8.19.0 v9.2.0 labels Jul 9, 2025
@elasticmachine
Copy link
Contributor

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

{
fieldSelected: Boolean(selectedFieldName),
controlType: factory.getDisplayName(),
controlType: factory.type,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line here fixes the range control tooltip. Everything else is for the delete button/modal.

import { i18n } from '@kbn/i18n';
import { coreServices } from '../services/kibana_services';

const openConfirmDeleteModal = (all: boolean) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a really nice utility.

One nit - why is this in common? Common should only contain code used by both server and public but this is only public code.

Copy link
Contributor

@nreese nreese Jul 9, 2025

Choose a reason for hiding this comment

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

nevermind. I now see the folder is controls/public/common, not controls/common

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-presentation changes LGTM - thanks for cleaning these UI elements up
code review only

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
controls 384 386 +2

Async chunks

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

id before after diff
controls 477.9KB 477.8KB -93.0B

History

@Zacqary Zacqary merged commit 092c22d into elastic:main Jul 9, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16178289512

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 9, 2025
… button (elastic#227295)

## Summary

### Fix tooltip for disabled range slider

When selecting a non-numerical field, the range slider was disabled with
this tooltip:

<img width="400" alt="Screenshot 2025-07-09 at 11 04 46 AM"
src="https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75"
/>

Looking at the error message code, this was not the intended behavior:

```ts
/** This shouldn't ever happen - but, adding just in case as a fallback. */
return i18n.translate(
  'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',
  {
    defaultMessage: 'Select a compatible control type.',
  }
);
```

This PR fixes this logic so the correct message is displayed:
<img width="320" alt="Screenshot 2025-07-09 at 11 04 14 AM"
src="https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000"
/>

### Move delete control button to flyout footer and add confirm dialog

When editing a control, a Delete Control button would appear here in the
flyout body, which is hard to spot if the screen height is small and the
user has to scroll down:

<img width="507" alt="Screenshot 2025-07-09 at 11 22 23 AM"
src="https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3"
/>

Clicking this button would also just immediately delete the control, and
failed to display this confirmation modal:
<img width="587" alt="Screenshot 2025-07-09 at 11 21 36 AM"
src="https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e"
/>

This PR adds the confirmation modal when trying to delete a control from
the edit flyout, and also moves the button to the flyout footer:
<img width="543" alt="Screenshot 2025-07-09 at 11 21 22 AM"
src="https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 092c22d)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 9, 2025
… button (elastic#227295)

## Summary

### Fix tooltip for disabled range slider

When selecting a non-numerical field, the range slider was disabled with
this tooltip:

<img width="400" alt="Screenshot 2025-07-09 at 11 04 46 AM"
src="https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75"
/>

Looking at the error message code, this was not the intended behavior:

```ts
/** This shouldn't ever happen - but, adding just in case as a fallback. */
return i18n.translate(
  'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',
  {
    defaultMessage: 'Select a compatible control type.',
  }
);
```

This PR fixes this logic so the correct message is displayed:
<img width="320" alt="Screenshot 2025-07-09 at 11 04 14 AM"
src="https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000"
/>

### Move delete control button to flyout footer and add confirm dialog

When editing a control, a Delete Control button would appear here in the
flyout body, which is hard to spot if the screen height is small and the
user has to scroll down:

<img width="507" alt="Screenshot 2025-07-09 at 11 22 23 AM"
src="https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3"
/>

Clicking this button would also just immediately delete the control, and
failed to display this confirmation modal:
<img width="587" alt="Screenshot 2025-07-09 at 11 21 36 AM"
src="https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e"
/>

This PR adds the confirmation modal when trying to delete a control from
the edit flyout, and also moves the button to the flyout footer:
<img width="543" alt="Screenshot 2025-07-09 at 11 21 22 AM"
src="https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 092c22d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 9, 2025
…ontrol button (#227295) (#227316)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Controls] Fix disabled range slider tooltip, clean up delete control
button (#227295)](#227295)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Zac
Xeper","email":"Zacqary@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-09T19:20:32Z","message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","Team:Presentation","loe:small","impact:medium","Project:Controls","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Controls]
Fix disabled range slider tooltip, clean up delete control
button","number":227295,"url":"https://github.com/elastic/kibana/pull/227295","mergeCommit":{"message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227295","number":227295,"mergeCommit":{"message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff"}}]}]
BACKPORT-->

Co-authored-by: Zac Xeper <Zacqary@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Jul 10, 2025
…control button (#227295) (#227315)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Controls] Fix disabled range slider tooltip, clean up delete control
button (#227295)](#227295)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Zac
Xeper","email":"Zacqary@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-09T19:20:32Z","message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Dashboard","release_note:fix","Team:Presentation","loe:small","impact:medium","Project:Controls","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Controls]
Fix disabled range slider tooltip, clean up delete control
button","number":227295,"url":"https://github.com/elastic/kibana/pull/227295","mergeCommit":{"message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227295","number":227295,"mergeCommit":{"message":"[Controls]
Fix disabled range slider tooltip, clean up delete control button
(#227295)\n\n## Summary\n\n### Fix tooltip for disabled range
slider\n\nWhen selecting a non-numerical field, the range slider was
disabled with\nthis tooltip:\n\n<img width=\"400\" alt=\"Screenshot
2025-07-09 at 11 04
46 AM\"\nsrc=\"https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75\"\n/>\n\nLooking
at the error message code, this was not the intended
behavior:\n\n```ts\n/** This shouldn't ever happen - but, adding just in
case as a fallback. */\nreturn i18n.translate(\n
'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',\n
{\n defaultMessage: 'Select a compatible control type.',\n
}\n);\n```\n\nThis PR fixes this logic so the correct message is
displayed:\n<img width=\"320\" alt=\"Screenshot 2025-07-09 at 11 04
14 AM\"\nsrc=\"https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000\"\n/>\n\n\n###
Move delete control button to flyout footer and add confirm
dialog\n\nWhen editing a control, a Delete Control button would appear
here in the\nflyout body, which is hard to spot if the screen height is
small and the\nuser has to scroll down:\n\n<img width=\"507\"
alt=\"Screenshot 2025-07-09 at 11 22
23 AM\"\nsrc=\"https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3\"\n/>\n\nClicking
this button would also just immediately delete the control, and\nfailed
to display this confirmation modal:\n<img width=\"587\" alt=\"Screenshot
2025-07-09 at 11 21
36 AM\"\nsrc=\"https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e\"\n/>\n\nThis
PR adds the confirmation modal when trying to delete a control from\nthe
edit flyout, and also moves the button to the flyout footer:\n<img
width=\"543\" alt=\"Screenshot 2025-07-09 at 11 21
22 AM\"\nsrc=\"https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a\"\n/>\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"092c22d036da68bf85644650e82aa68a37a757ff"}}]}]
BACKPORT-->

Co-authored-by: Zac Xeper <Zacqary@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
… button (elastic#227295)

## Summary

### Fix tooltip for disabled range slider

When selecting a non-numerical field, the range slider was disabled with
this tooltip:

<img width="400" alt="Screenshot 2025-07-09 at 11 04 46 AM"
src="https://github.com/user-attachments/assets/45ac7d9a-9009-40ed-839d-e5f47a547f75"
/>

Looking at the error message code, this was not the intended behavior:

```ts
/** This shouldn't ever happen - but, adding just in case as a fallback. */
return i18n.translate(
  'controls.controlGroup.manageControl.dataSource.controlTypeErrorMessage.default',
  {
    defaultMessage: 'Select a compatible control type.',
  }
);
```

This PR fixes this logic so the correct message is displayed:
<img width="320" alt="Screenshot 2025-07-09 at 11 04 14 AM"
src="https://github.com/user-attachments/assets/ea37385c-fdab-48c9-8e52-538411895000"
/>


### Move delete control button to flyout footer and add confirm dialog

When editing a control, a Delete Control button would appear here in the
flyout body, which is hard to spot if the screen height is small and the
user has to scroll down:

<img width="507" alt="Screenshot 2025-07-09 at 11 22 23 AM"
src="https://github.com/user-attachments/assets/9f6cb214-41ca-4d6f-87cd-08240aaa73d3"
/>

Clicking this button would also just immediately delete the control, and
failed to display this confirmation modal:
<img width="587" alt="Screenshot 2025-07-09 at 11 21 36 AM"
src="https://github.com/user-attachments/assets/60c73cd0-5336-483d-a655-b868fffde94e"
/>

This PR adds the confirmation modal when trying to delete a control from
the edit flyout, and also moves the button to the flyout footer:
<img width="543" alt="Screenshot 2025-07-09 at 11 21 22 AM"
src="https://github.com/user-attachments/assets/5d3553c0-a42f-4cd1-ac4d-f2465e2a669a"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Dashboard Dashboard related features impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort Project:Controls release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.19.0 v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants