Skip to content

[Dashboard] Presentation panel refactor#207275

Merged
Heenawter merged 45 commits intoelastic:mainfrom
Heenawter:improve-hover-actions-performance_2025-01-16
Feb 5, 2025
Merged

[Dashboard] Presentation panel refactor#207275
Heenawter merged 45 commits intoelastic:mainfrom
Heenawter:improve-hover-actions-performance_2025-01-16

Conversation

@Heenawter
Copy link
Copy Markdown
Contributor

@Heenawter Heenawter commented Jan 21, 2025

Closes #206686
Closes #197897
Part of #207852

Summary

This PR is a major refactor of the PresentationPanel component, including an overhaul of the hover action and panel title components. Some notable highlights include:

  • All styles in the PresentationPanel component were moved from SASS to Emotion

  • The over-complicated logic to combine hover actions when the panel shrinks was removed in favour of CSS, driven by a container query Removing the updateCombineHoverActions function (which was defined in a React component and not memoized) also made a difference in performance when dragging:

    Before After
    image image
  • The over-complicated logic defined in usePresentationPanelTitleClickHandle, which was meant to ignore the onClick that would trigger after a panel was dragged, was converted to 2 lines of CSS

Small usability improvements

This PR also includes a few small usability improvements, such as:

  • Ensuring that only the first row of hover actions overlaps with the Dashboard's sticky top navigation bar, and this only happens when the dashboard has no controls. This results in much better behaviour in most scenarios:

    Before After
    Jan-27-2025 16-14-26 Jan-27-2025 16-13-41
  • Adding a small delay for hiding the hover actions on mouse leave, which makes it a lot easier to grab the drag handle:

    Before After
    Jan-27-2025 16-21-11 Jan-27-2025 16-20-17
  • Preventing the resize handle from overlapping Dashboard's stick top navigation:

    Before After
    Jan-27-2025 16-24-31 Jan-27-2025 16-25-04

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@Heenawter Heenawter added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor performance technical debt Improvement of the software architecture and operational architecture labels Jan 22, 2025
Copy link
Copy Markdown
Contributor

@andreadelrio andreadelrio left a comment

Choose a reason for hiding this comment

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

Design changes LGTM. Amazing cleanup and improvements!

@Heenawter Heenawter merged commit c35698b into elastic:main Feb 5, 2025
@Heenawter Heenawter added backport:skip This PR does not require backporting and removed backport:prev-minor labels Feb 5, 2025
@Heenawter Heenawter deleted the improve-hover-actions-performance_2025-01-16 branch February 5, 2025 22:20
@elastic elastic deleted a comment from kibanamachine Feb 5, 2025
@Heenawter Heenawter added backport:version Backport to applied version labels v8.19.0 and removed backport:skip This PR does not require backporting labels Feb 5, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 207275

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 207275

Questions ?

Please refer to the Backport tool documentation

Heenawter added a commit that referenced this pull request Feb 6, 2025
…#209937)

## Summary

Since #207275 is too large to
backport to `9.0`/`8.18` and will only be in `9.1`/`8.19`, I wanted to
at least backport **just** the z-index fix for the resize handler as
described
[here](https://github.com/elastic/kibana/pull/207275/files#r1931305375)
. Unfortunately, the z-index used in that PR
(`euiTheme.levels.maskBelowHeader`) only works thanks to other
hover-action style changes, so I've had to set a hardcoded z-index
(`2000`) in this PR instead. This acts as a "quick fix" for a pretty
annoying bug while avoiding the risk of backporting the entire
presentation panel refactor PR to `9.0`/`8.18`


| Before | After |
|--------|--------|
| ![Screenshot 2025-01-23 at 5 49
13 PM](https://github.com/user-attachments/assets/ea5f2ffe-46bd-4259-920a-8798a1a08775)
|
![image](https://github.com/user-attachments/assets/52a6ac63-5bb3-4cc0-a77d-99cac756aaa4)
|
@Heenawter
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

Heenawter added a commit to Heenawter/kibana that referenced this pull request Feb 6, 2025
Closes elastic#206686
Closes elastic#197897
Part of elastic#207852

## Summary

This PR is a major refactor of the `PresentationPanel` component,
including an overhaul of the hover action and panel title components.
Some notable highlights include:
- All styles in the `PresentationPanel` component were moved from SASS
to Emotion
- The over-complicated logic to combine hover actions when the panel
shrinks was removed in favour of CSS, driven by a [container
query](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)
Removing the `updateCombineHoverActions` function (which was defined in
a React component and not memoized) also made a difference in
performance when dragging:

   | Before | After |
   |--------|--------|
|
![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)
|
![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)
|

- The over-complicated logic defined in
`usePresentationPanelTitleClickHandle`, which was meant to ignore the
`onClick` that would trigger after a panel was dragged, was converted to
2 lines of CSS

### Small usability improvements

This PR also includes a few small usability improvements, such as:

- Ensuring that only the **first** row of hover actions overlaps with
the Dashboard's sticky top navigation bar, and this only happens when
the dashboard has no controls. This results in much better behaviour in
most scenarios:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)
| ![Jan-27-2025
16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)
|

- Adding a small delay for hiding the hover actions on mouse leave,
which makes it a lot easier to grab the drag handle:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)
| ![Jan-27-2025
16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)
|

- Preventing the resize handle from overlapping Dashboard's stick top
navigation:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)
| ![Jan-27-2025
16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)
|

### 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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c35698b)

# Conflicts:
#	src/platform/plugins/private/presentation_panel/public/panel_component/_presentation_panel.scss
#	src/platform/plugins/shared/dashboard/public/dashboard_container/component/grid/use_layout_styles.tsx
Heenawter added a commit to Heenawter/kibana that referenced this pull request Feb 6, 2025
…elastic#209937)

## Summary

Since elastic#207275 is too large to
backport to `9.0`/`8.18` and will only be in `9.1`/`8.19`, I wanted to
at least backport **just** the z-index fix for the resize handler as
described
[here](https://github.com/elastic/kibana/pull/207275/files#r1931305375)
. Unfortunately, the z-index used in that PR
(`euiTheme.levels.maskBelowHeader`) only works thanks to other
hover-action style changes, so I've had to set a hardcoded z-index
(`2000`) in this PR instead. This acts as a "quick fix" for a pretty
annoying bug while avoiding the risk of backporting the entire
presentation panel refactor PR to `9.0`/`8.18`

| Before | After |
|--------|--------|
| ![Screenshot 2025-01-23 at 5 49
13 PM](https://github.com/user-attachments/assets/ea5f2ffe-46bd-4259-920a-8798a1a08775)
|
![image](https://github.com/user-attachments/assets/52a6ac63-5bb3-4cc0-a77d-99cac756aaa4)
|

(cherry picked from commit 7ebe1bf)
Heenawter added a commit that referenced this pull request Feb 6, 2025
… header (#209937) (#210031)

# Backport

This will backport the following commits from `9.0` to `8.18`:
- [[9.0] [Dashboard] Ensure resize handle does not overlap sticky header
(#209937)](#209937)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-06T15:03:28Z","message":"[9.0]
[Dashboard] Ensure resize handle does not overlap sticky header
(#209937)\n\n## Summary\r\n\r\nSince
#207275 is too large
to\r\nbackport to `9.0`/`8.18` and will only be in `9.1`/`8.19`, I
wanted to\r\nat least backport **just** the z-index fix for the resize
handler
as\r\ndescribed\r\n[here](https://github.com/elastic/kibana/pull/207275/files#r1931305375)\r\n.
Unfortunately, the z-index used in that
PR\r\n(`euiTheme.levels.maskBelowHeader`) only works thanks to
other\r\nhover-action style changes, so I've had to set a hardcoded
z-index\r\n(`2000`) in this PR instead. This acts as a \"quick fix\" for
a pretty\r\nannoying bug while avoiding the risk of backporting the
entire\r\npresentation panel refactor PR to `9.0`/`8.18`\r\n\r\n\r\n|
Before | After |\r\n|--------|--------|\r\n| ![Screenshot 2025-01-23 at
5
49\r\n13 PM](https://github.com/user-attachments/assets/ea5f2ffe-46bd-4259-920a-8798a1a08775)\r\n|\r\n![image](https://github.com/user-attachments/assets/52a6ac63-5bb3-4cc0-a77d-99cac756aaa4)\r\n|","sha":"7ebe1bf8d020e5b732b22aa2a23adaae8bb5bb48","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","loe:small","release_note:skip","impact:low","backport:version","v8.18.0"],"title":"[9.0]
[Dashboard] Ensure resize handle does not overlap sticky
header","number":209937,"url":"https://github.com/elastic/kibana/pull/209937","mergeCommit":{"message":"[9.0]
[Dashboard] Ensure resize handle does not overlap sticky header
(#209937)\n\n## Summary\r\n\r\nSince
#207275 is too large
to\r\nbackport to `9.0`/`8.18` and will only be in `9.1`/`8.19`, I
wanted to\r\nat least backport **just** the z-index fix for the resize
handler
as\r\ndescribed\r\n[here](https://github.com/elastic/kibana/pull/207275/files#r1931305375)\r\n.
Unfortunately, the z-index used in that
PR\r\n(`euiTheme.levels.maskBelowHeader`) only works thanks to
other\r\nhover-action style changes, so I've had to set a hardcoded
z-index\r\n(`2000`) in this PR instead. This acts as a \"quick fix\" for
a pretty\r\nannoying bug while avoiding the risk of backporting the
entire\r\npresentation panel refactor PR to `9.0`/`8.18`\r\n\r\n\r\n|
Before | After |\r\n|--------|--------|\r\n| ![Screenshot 2025-01-23 at
5
49\r\n13 PM](https://github.com/user-attachments/assets/ea5f2ffe-46bd-4259-920a-8798a1a08775)\r\n|\r\n![image](https://github.com/user-attachments/assets/52a6ac63-5bb3-4cc0-a77d-99cac756aaa4)\r\n|","sha":"7ebe1bf8d020e5b732b22aa2a23adaae8bb5bb48"}},"sourceBranch":"9.0","suggestedTargetBranches":["8.18"],"targetPullRequestStates":[{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Heenawter added a commit that referenced this pull request Feb 6, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Dashboard] Presentation panel refactor
(#207275)](#207275)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-05T22:18:04Z","message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["performance","Team:Presentation","loe:medium","technical
debt","release_note:skip","impact:high","backport:version","v9.1.0","v8.19.0"],"title":"[Dashboard]
Presentation panel
refactor","number":207275,"url":"https://github.com/elastic/kibana/pull/207275","mergeCommit":{"message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207275","number":207275,"mergeCommit":{"message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
drewdaemon pushed a commit to drewdaemon/kibana that referenced this pull request Feb 6, 2025
Closes elastic#206686
Closes elastic#197897
Part of elastic#207852

## Summary

This PR is a major refactor of the `PresentationPanel` component,
including an overhaul of the hover action and panel title components.
Some notable highlights include:
- All styles in the `PresentationPanel` component were moved from SASS
to Emotion
- The over-complicated logic to combine hover actions when the panel
shrinks was removed in favour of CSS, driven by a [container
query](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)
Removing the `updateCombineHoverActions` function (which was defined in
a React component and not memoized) also made a difference in
performance when dragging:
    
   | Before | After |
   |--------|--------|
|
![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)
|
![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)
|
      

- The over-complicated logic defined in
`usePresentationPanelTitleClickHandle`, which was meant to ignore the
`onClick` that would trigger after a panel was dragged, was converted to
2 lines of CSS

### Small usability improvements

This PR also includes a few small usability improvements, such as:

- Ensuring that only the **first** row of hover actions overlaps with
the Dashboard's sticky top navigation bar, and this only happens when
the dashboard has no controls. This results in much better behaviour in
most scenarios:
  
  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)
| ![Jan-27-2025
16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)
|

- Adding a small delay for hiding the hover actions on mouse leave,
which makes it a lot easier to grab the drag handle:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)
| ![Jan-27-2025
16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)
|

- Preventing the resize handle from overlapping Dashboard's stick top
navigation:

  | Before | After |
  |--------|--------|
| ![Jan-27-2025
16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)
| ![Jan-27-2025
16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)
|


### 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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Heenawter added a commit that referenced this pull request Feb 11, 2025
…10466)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[kbn-grid-layout] Cleanup memoization and styling
(#210285)](#210285)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-05T22:18:04Z","message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["performance","Team:Presentation","loe:medium","technical
debt","release_note:skip","impact:high","backport:version","v9.1.0","v8.19.0"],"title":"[Dashboard]
Presentation panel
refactor","number":207275,"url":"https://github.com/elastic/kibana/pull/207275","mergeCommit":{"message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207275","number":207275,"mergeCommit":{"message":"[Dashboard]
Presentation panel refactor (#207275)\n\nCloses
https://github.com/elastic/kibana/issues/206686\r\nCloses
https://github.com/elastic/kibana/issues/197897\r\nPart of
https://github.com/elastic/kibana/issues/207852\r\n\r\n##
Summary\r\n\r\nThis PR is a major refactor of the `PresentationPanel`
component,\r\nincluding an overhaul of the hover action and panel title
components.\r\nSome notable highlights include:\r\n- All styles in the
`PresentationPanel` component were moved from SASS\r\nto Emotion\r\n-
The over-complicated logic to combine hover actions when the
panel\r\nshrinks was removed in favour of CSS, driven by a
[container\r\nquery](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries)\r\nRemoving
the `updateCombineHoverActions` function (which was defined in\r\na
React component and not memoized) also made a difference
in\r\nperformance when dragging:\r\n \r\n | Before | After |\r\n
|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/e66898d6-a6fc-42c7-9e24-f116d3bd85a6)\r\n|\r\n![image](https://github.com/user-attachments/assets/1f1d75ba-2ebc-4def-9d2e-14dfd5e1a585)\r\n|\r\n
\r\n\r\n- The over-complicated logic defined
in\r\n`usePresentationPanelTitleClickHandle`, which was meant to ignore
the\r\n`onClick` that would trigger after a panel was dragged, was
converted to\r\n2 lines of CSS\r\n\r\n### Small usability
improvements\r\n\r\nThis PR also includes a few small usability
improvements, such as:\r\n\r\n- Ensuring that only the **first** row of
hover actions overlaps with\r\nthe Dashboard's sticky top navigation
bar, and this only happens when\r\nthe dashboard has no controls. This
results in much better behaviour in\r\nmost scenarios:\r\n \r\n | Before
| After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-14-26](https://github.com/user-attachments/assets/2bf5eaa0-06ab-4d87-897f-d217f189daf7)\r\n|
![Jan-27-2025\r\n16-13-41](https://github.com/user-attachments/assets/61b0f06a-1363-4bfc-8a2b-c57a3e736552)\r\n|\r\n\r\n-
Adding a small delay for hiding the hover actions on mouse
leave,\r\nwhich makes it a lot easier to grab the drag handle:\r\n\r\n |
Before | After |\r\n |--------|--------|\r\n|
![Jan-27-2025\r\n16-21-11](https://github.com/user-attachments/assets/65138e53-1856-44f0-913f-01383b8aa6c2)\r\n|
![Jan-27-2025\r\n16-20-17](https://github.com/user-attachments/assets/7c8ba4d8-8b77-4bc5-85af-a082cace1f96)\r\n|\r\n\r\n-
Preventing the resize handle from overlapping Dashboard's stick
top\r\nnavigation:\r\n\r\n | Before | After |\r\n
|--------|--------|\r\n|
![Jan-27-2025\r\n16-24-31](https://github.com/user-attachments/assets/5363a302-5f6a-4483-9782-516023567d87)\r\n|
![Jan-27-2025\r\n16-25-04](https://github.com/user-attachments/assets/8614d025-b45b-4af2-81d6-c62a086ca427)\r\n|\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c35698bcf81314f833467fde2d3c14785b83c1ad"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Heenawter added a commit that referenced this pull request Feb 11, 2025
## Summary

When #207275 merged, some Security
Cypress tests started failing because the embeddables were no longer
taking up any width in their containers. This was caused by us switching
over to using the CSS container type `inline-size` on the hover anchor
wrapper, which makes it so that it can no longer be sized to its
contents (see [this
comment](https://stackoverflow.com/a/73980194/28754956) for a really
good explanation). Instead, the width of the `PresentationPanel` needs
to be set **by the parent** - so, by applying the `min-width` to the
Metric wrapper rather than the Lens embeddable, the metric now takes up
the expected width:

| Before | After |
|--------|--------|
|
![image](https://github.com/user-attachments/assets/0aa1d563-e50f-4a3d-a91e-3555b7e0d48d)
|
![image](https://github.com/user-attachments/assets/1fa9d728-b84e-4c1a-958f-76734ff6c95f)
|

When doing this work, I noticed that, because we added a delay to hiding
the hover actions, there was a slightly jarring transition when hovering
over panels without `border` enabled. So, I fixed this by adding a
transition to the border on the panel as well, so that it matches the
animation on the hover actions:

| Before | After |
|--------|--------|
| ![Feb-07-2025
11-09-33](https://github.com/user-attachments/assets/9b2a0c67-47fe-46a5-81e8-42231ed7b0a3)
| ![Feb-07-2025
11-08-26](https://github.com/user-attachments/assets/35d50475-174c-4cba-8c42-76521f79f235)
|



### 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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Heenawter added a commit to Heenawter/kibana that referenced this pull request Feb 11, 2025
## Summary

When elastic#207275 merged, some Security
Cypress tests started failing because the embeddables were no longer
taking up any width in their containers. This was caused by us switching
over to using the CSS container type `inline-size` on the hover anchor
wrapper, which makes it so that it can no longer be sized to its
contents (see [this
comment](https://stackoverflow.com/a/73980194/28754956) for a really
good explanation). Instead, the width of the `PresentationPanel` needs
to be set **by the parent** - so, by applying the `min-width` to the
Metric wrapper rather than the Lens embeddable, the metric now takes up
the expected width:

| Before | After |
|--------|--------|
|
![image](https://github.com/user-attachments/assets/0aa1d563-e50f-4a3d-a91e-3555b7e0d48d)
|
![image](https://github.com/user-attachments/assets/1fa9d728-b84e-4c1a-958f-76734ff6c95f)
|

When doing this work, I noticed that, because we added a delay to hiding
the hover actions, there was a slightly jarring transition when hovering
over panels without `border` enabled. So, I fixed this by adding a
transition to the border on the panel as well, so that it matches the
animation on the hover actions:

| Before | After |
|--------|--------|
| ![Feb-07-2025
11-09-33](https://github.com/user-attachments/assets/9b2a0c67-47fe-46a5-81e8-42231ed7b0a3)
| ![Feb-07-2025
11-08-26](https://github.com/user-attachments/assets/35d50475-174c-4cba-8c42-76521f79f235)
|

### 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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 3716441)

# Conflicts:
#	x-pack/test/security_solution_cypress/cypress/e2e/explore/inspect/inspect_button.cy.ts
Heenawter added a commit that referenced this pull request Feb 12, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Embeddable] Fix presentation panel styles
(#210113)](#210113)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-11T18:11:18Z","message":"[Embeddable]
Fix presentation panel styles (#210113)\n\n## Summary\r\n\r\nWhen
#207275 merged, some
Security\r\nCypress tests started failing because the embeddables were
no longer\r\ntaking up any width in their containers. This was caused by
us switching\r\nover to using the CSS container type `inline-size` on
the hover anchor\r\nwrapper, which makes it so that it can no longer be
sized to its\r\ncontents (see
[this\r\ncomment](https://stackoverflow.com/a/73980194/28754956) for a
really\r\ngood explanation). Instead, the width of the
`PresentationPanel` needs\r\nto be set **by the parent** - so, by
applying the `min-width` to the\r\nMetric wrapper rather than the Lens
embeddable, the metric now takes up\r\nthe expected width:\r\n\r\n|
Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/0aa1d563-e50f-4a3d-a91e-3555b7e0d48d)\r\n|\r\n![image](https://github.com/user-attachments/assets/1fa9d728-b84e-4c1a-958f-76734ff6c95f)\r\n|\r\n\r\nWhen
doing this work, I noticed that, because we added a delay to
hiding\r\nthe hover actions, there was a slightly jarring transition
when hovering\r\nover panels without `border` enabled. So, I fixed this
by adding a\r\ntransition to the border on the panel as well, so that it
matches the\r\nanimation on the hover actions:\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|
![Feb-07-2025\r\n11-09-33](https://github.com/user-attachments/assets/9b2a0c67-47fe-46a5-81e8-42231ed7b0a3)\r\n|
![Feb-07-2025\r\n11-08-26](https://github.com/user-attachments/assets/35d50475-174c-4cba-8c42-76521f79f235)\r\n|\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"3716441c38459d911145c40fea4322ff53927ab4","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["regression","release_note:fix","Team:Presentation","loe:small","impact:medium","Feature:Embeddables","backport:version","v9.1.0","v8.19.0"],"title":"[Embeddable]
Fix presentation panel
styles","number":210113,"url":"https://github.com/elastic/kibana/pull/210113","mergeCommit":{"message":"[Embeddable]
Fix presentation panel styles (#210113)\n\n## Summary\r\n\r\nWhen
#207275 merged, some
Security\r\nCypress tests started failing because the embeddables were
no longer\r\ntaking up any width in their containers. This was caused by
us switching\r\nover to using the CSS container type `inline-size` on
the hover anchor\r\nwrapper, which makes it so that it can no longer be
sized to its\r\ncontents (see
[this\r\ncomment](https://stackoverflow.com/a/73980194/28754956) for a
really\r\ngood explanation). Instead, the width of the
`PresentationPanel` needs\r\nto be set **by the parent** - so, by
applying the `min-width` to the\r\nMetric wrapper rather than the Lens
embeddable, the metric now takes up\r\nthe expected width:\r\n\r\n|
Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/0aa1d563-e50f-4a3d-a91e-3555b7e0d48d)\r\n|\r\n![image](https://github.com/user-attachments/assets/1fa9d728-b84e-4c1a-958f-76734ff6c95f)\r\n|\r\n\r\nWhen
doing this work, I noticed that, because we added a delay to
hiding\r\nthe hover actions, there was a slightly jarring transition
when hovering\r\nover panels without `border` enabled. So, I fixed this
by adding a\r\ntransition to the border on the panel as well, so that it
matches the\r\nanimation on the hover actions:\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|
![Feb-07-2025\r\n11-09-33](https://github.com/user-attachments/assets/9b2a0c67-47fe-46a5-81e8-42231ed7b0a3)\r\n|
![Feb-07-2025\r\n11-08-26](https://github.com/user-attachments/assets/35d50475-174c-4cba-8c42-76521f79f235)\r\n|\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"3716441c38459d911145c40fea4322ff53927ab4"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210113","number":210113,"mergeCommit":{"message":"[Embeddable]
Fix presentation panel styles (#210113)\n\n## Summary\r\n\r\nWhen
#207275 merged, some
Security\r\nCypress tests started failing because the embeddables were
no longer\r\ntaking up any width in their containers. This was caused by
us switching\r\nover to using the CSS container type `inline-size` on
the hover anchor\r\nwrapper, which makes it so that it can no longer be
sized to its\r\ncontents (see
[this\r\ncomment](https://stackoverflow.com/a/73980194/28754956) for a
really\r\ngood explanation). Instead, the width of the
`PresentationPanel` needs\r\nto be set **by the parent** - so, by
applying the `min-width` to the\r\nMetric wrapper rather than the Lens
embeddable, the metric now takes up\r\nthe expected width:\r\n\r\n|
Before | After
|\r\n|--------|--------|\r\n|\r\n![image](https://github.com/user-attachments/assets/0aa1d563-e50f-4a3d-a91e-3555b7e0d48d)\r\n|\r\n![image](https://github.com/user-attachments/assets/1fa9d728-b84e-4c1a-958f-76734ff6c95f)\r\n|\r\n\r\nWhen
doing this work, I noticed that, because we added a delay to
hiding\r\nthe hover actions, there was a slightly jarring transition
when hovering\r\nover panels without `border` enabled. So, I fixed this
by adding a\r\ntransition to the border on the panel as well, so that it
matches the\r\nanimation on the hover actions:\r\n\r\n| Before | After
|\r\n|--------|--------|\r\n|
![Feb-07-2025\r\n11-09-33](https://github.com/user-attachments/assets/9b2a0c67-47fe-46a5-81e8-42231ed7b0a3)\r\n|
![Feb-07-2025\r\n11-08-26](https://github.com/user-attachments/assets/35d50475-174c-4cba-8c42-76521f79f235)\r\n|\r\n\r\n\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"3716441c38459d911145c40fea4322ff53927ab4"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
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 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort performance release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// technical debt Improvement of the software architecture and operational architecture v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Make hover actions more performant [dashboard] hover actions cover search bar

5 participants