Skip to content

[Dashboard] Improve perceived performance of dashboard flyouts#226052

Merged
mbondyra merged 53 commits intoelastic:mainfrom
mbondyra:dashboard_flyout_lazy_temp
Jul 15, 2025
Merged

[Dashboard] Improve perceived performance of dashboard flyouts#226052
mbondyra merged 53 commits intoelastic:mainfrom
mbondyra:dashboard_flyout_lazy_temp

Conversation

@mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jul 1, 2025

✨ Summary

This PR introduces a new openLazyFlyout helper to improve the perceived performance and accessibility of dashboard flyouts by changing the interaction flow. The flow is applied for the majority of the dashboard flyouts, but not all. The remaining work is encapsulated in this issue: #227446

🧠 Previous pattern

  1. User clicks a button
  2. Setup logic runs (dependencies, content load)
  3. Flyout opens once ready

Wait)

✅ New pattern

  1. User clicks a button
  2. Show a loading flyout immediately
  3. Load the actual content asynchronously
  4. Replace the placeholder with real content once ready
Jul-08-2025.15-44-37.mp4

📦 Key Features

  • openLazyFlyout utility to encapsulate the new flow
  • Push-style flyouts by default (type: 'push')
  • Async content loading with a nice-looking skeleton loader
  • Focus management:
    • Focuses first focusable element on open
    • Returns focus to triggerId on close
  • aria-labelledby support for proper flyout labeling

🎯 Benefits

  • **Better perceived performance and UX since the app doesn't feel jumpy **
  • Improved accessibility (focus handling, ARIA labeling)
  • Cleaner architecture: encapsulated logic, reusability

🐛 Bug Fixes

This PR resolves the following issues:

Fixes #225094 – 'push' flyout as a default
Fixes #188575 - a long pause between clicking and showing the flyout

A11y:
Fixes #214921
Fixes #214505
Fixes #215508
Fixes #195026
Fixes #215845

In addition, this PR improves many unreported accessibility issues around focus and announcements.


📸 Visuals

Loading flyout:

Screenshot 2025-07-08 at 15 45 59
@mbondyra mbondyra force-pushed the dashboard_flyout_lazy_temp branch 6 times, most recently from 1a0a71b to b989c6d Compare July 6, 2025 22:40
@mbondyra mbondyra changed the title [Dashboard] Flyouts Jul 7, 2025
@mbondyra mbondyra force-pushed the dashboard_flyout_lazy_temp branch from 724afa1 to 9e8aa04 Compare July 7, 2025 08:52
@mbondyra mbondyra changed the title [Dashboard] Improve perceived performance of dashboard image flyout Jul 7, 2025
@mbondyra mbondyra force-pushed the dashboard_flyout_lazy_temp branch 5 times, most recently from ab86e7c to 5b7ff59 Compare July 8, 2025 12:16
@mbondyra mbondyra marked this pull request as ready for review July 8, 2025 14:01
@mbondyra mbondyra requested review from a team as code owners July 8, 2025 14:01
@elastic elastic deleted a comment from elasticmachine Jul 8, 2025
@mbondyra mbondyra added v9.1.0 release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// backport:skip This PR does not require backporting labels Jul 8, 2025
@elasticmachine
Copy link
Contributor

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

@mbondyra mbondyra force-pushed the dashboard_flyout_lazy_temp branch from bac049f to 94a2aae Compare July 8, 2025 14:05
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Jul 8, 2025
@elastic elastic deleted a comment from elasticmachine Jul 8, 2025
Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

I smoked checked image panel 👍

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. Thank you for taking on this effort. Its great to see a consolidation of dashboard flyouts logic
code review and tested in chrome

Copy link
Member

@umbopepato umbopepato left a comment

Choose a reason for hiding this comment

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

Thanks @mbondyra for addressing the flyout config issue so quickly! 💯
I noticed that the new flyout squeezes the rule-from-viz creation form a bit too much and makes things harder to read. Would it be possible to make the flyout size configurable to accoun for these larger UIs that need a bit more screen estate?

Screenshot 2025-07-11 at 15 56 09
…d_flyout_lazy_temp

# Conflicts:
#	x-pack/platform/plugins/shared/dashboard_enhanced/public/plugin.ts
mbondyra added a commit that referenced this pull request Jul 14, 2025
# Summary
Hi Operations team! 👋

Recently I've worked on a
[few](#227593)
[PRs](#226052) that reduce our
page load bundle size, and while doing so I noticed that many of our
limits are much higher than the actual page load sizes. It made me
think: these limits should be realistic, because they’re one of the main
ways we protect page load performance.
Right now, based on the current limits, we theoretically allow up to
11,452,104 bytes (~11 MB) to load upfront. But when we check the real
page load, it’s only 5.192.979 bytes — about half of that.

We already have a `--update-limits` flag for the `node
scripts/build_kibana_platform_plugins.js --update-limits` command, but
it only bumps limits up when the size grows above the limit, adding a
flat 15 KB buffer to the bundle size.
I’d like to propose:
1. Allowing the `--update-limits` to allow folks to also lower limits
when the bundle shrinks drastically
2. Replacing the flat 15 KB buffer with 10% of the plugin’s size, so the
buffer scales realistically. Right now, with ~197 plugins,
`--update-limits` allows for an extra (15KB*197=) 3 MB above the total
page size — which is way too much in my opinion!

## What’s in this PR
✅ Adds logic to let us lower limits automatically, not just bump them up
with `node scripts/build_kibana_platform_plugins.js --update-limits`
✅ Replaces the flat +15 KB bump with a 10% buffer relative to each
plugin’s size when using `node scripts/build_kibana_platform_plugins.js
--update-limits`
✅ Updated the limits.yml with the result from the above script

## Why it matters
1. Keeps bundle sizes tight
2. Protects us from accidental regressions
Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Code looks good, tested locally and works perfect! 🎉

Copy link
Member

@umbopepato umbopepato left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @mbondyra for fixing the alerts panel issues 😊
Added a small nit suggestion

@mbondyra mbondyra force-pushed the dashboard_flyout_lazy_temp branch from 77ecbc7 to b30f6d8 Compare July 15, 2025 09:41
@mbondyra mbondyra added v9.2.0 and removed v9.1.0 labels Jul 15, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 595 599 +4
apm 2010 2009 -1
controls 386 390 +4
dashboard 678 682 +4
dashboardEnhanced 119 120 +1
dataVisualizer 750 754 +4
discover 1426 1425 -1
embeddable 107 105 -2
embeddableAlertsTable 521 525 +4
esql 119 124 +5
imageEmbeddable 151 155 +4
lens 1422 1426 +4
links 134 132 -2
maps 1281 1280 -1
ml 2517 2521 +4
presentationPanel 145 149 +4
slo 1276 1275 -1
synthetics 1366 1365 -1
triggersActionsUi 990 984 -6
visualizations 559 558 -1
total +26

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/presentation-containers 77 71 -6
navigation 56 57 +1
total -5

Async chunks

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

id before after diff
aiops 504.3KB 504.5KB +171.0B
apm 2.6MB 2.6MB -337.0B
canvas 1.1MB 1.1MB +26.0B
controls 477.7KB 482.5KB +4.8KB
dashboard 616.8KB 619.6KB +2.8KB
dashboardEnhanced 58.0KB 66.5KB +8.6KB
datasetQuality 418.6KB 418.2KB -345.0B
dataVisualizer 681.3KB 681.0KB -310.0B
discover 1.1MB 1.1MB -640.0B
embeddable 59.4KB 57.7KB -1.7KB
embeddableAlertsTable 914.1KB 915.8KB +1.7KB
esql 249.5KB 251.0KB +1.5KB
imageEmbeddable 110.3KB 111.3KB +1.0KB
infra 1.0MB 1.0MB -2.3KB
lens 1.5MB 1.5MB +2.0KB
links 114.3KB 109.6KB -4.7KB
ml 5.4MB 5.4MB -2.5KB
monitoring 630.6KB 630.3KB -331.0B
observability 1.3MB 1.3MB -343.0B
presentationPanel 95.8KB 98.2KB +2.4KB
slo 975.0KB 974.9KB -102.0B
synthetics 1.0MB 1.0MB -1.0KB
transform 621.8KB 621.4KB -335.0B
triggersActionsUi 1.5MB 1.5MB -11.6KB
uiActionsEnhanced 126.9KB 126.9KB +29.0B
uptime 491.1KB 490.8KB -323.0B
total -1.6KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/presentation-containers 1 0 -1
@kbn/presentation-util - 1 +1
total -0

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
aiops 17.7KB 17.6KB -52.0B
dashboardEnhanced 16.5KB 11.8KB -4.8KB
discover 22.4KB 22.4KB -18.0B
embeddable 16.7KB 16.8KB +131.0B
embeddableAlertsTable 5.9KB 5.9KB +69.0B
esql 9.2KB 9.2KB +30.0B
imageEmbeddable 6.2KB 5.8KB -482.0B
infra 50.0KB 50.0KB +33.0B
lens 59.3KB 59.3KB +50.0B
links 8.1KB 8.3KB +134.0B
navigation 12.1KB 12.1KB +12.0B
observability 95.8KB 95.8KB -9.0B
presentationPanel 10.2KB 10.2KB +31.0B
triggersActionsUi 112.3KB 107.2KB -5.0KB
total -9.9KB
Unknown metric groups

API count

id before after diff
@kbn/presentation-containers 88 82 -6
@kbn/presentation-util - 9 +9
navigation 59 60 +1
total +4

async chunk count

id before after diff
aiops 38 39 +1
apm 73 72 -1
controls 2 4 +2
dashboard 9 11 +2
dashboardEnhanced 1 4 +3
datasetQuality 16 15 -1
discover 37 35 -2
embeddable 2 1 -1
imageEmbeddable 8 9 +1
ml 118 117 -1
monitoring 9 8 -1
observability 24 23 -1
presentationPanel 2 3 +1
slo 33 32 -1
synthetics 16 15 -1
transform 8 7 -1
triggersActionsUi 57 59 +2
uptime 14 13 -1
total -0

References to deprecated APIs

id before after diff
dashboardEnhanced 5 3 -2
imageEmbeddable 2 1 -1
total -3

History

@mbondyra mbondyra merged commit 259d762 into elastic:main Jul 15, 2025
16 of 17 checks passed
@mbondyra mbondyra deleted the dashboard_flyout_lazy_temp branch July 15, 2025 12:06
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
# Summary
Hi Operations team! 👋

Recently I've worked on a
[few](elastic#227593)
[PRs](elastic#226052) that reduce our
page load bundle size, and while doing so I noticed that many of our
limits are much higher than the actual page load sizes. It made me
think: these limits should be realistic, because they’re one of the main
ways we protect page load performance.
Right now, based on the current limits, we theoretically allow up to
11,452,104 bytes (~11 MB) to load upfront. But when we check the real
page load, it’s only 5.192.979 bytes — about half of that.

We already have a `--update-limits` flag for the `node
scripts/build_kibana_platform_plugins.js --update-limits` command, but
it only bumps limits up when the size grows above the limit, adding a
flat 15 KB buffer to the bundle size.
I’d like to propose:
1. Allowing the `--update-limits` to allow folks to also lower limits
when the bundle shrinks drastically
2. Replacing the flat 15 KB buffer with 10% of the plugin’s size, so the
buffer scales realistically. Right now, with ~197 plugins,
`--update-limits` allows for an extra (15KB*197=) 3 MB above the total
page size — which is way too much in my opinion!

## What’s in this PR
✅ Adds logic to let us lower limits automatically, not just bump them up
with `node scripts/build_kibana_platform_plugins.js --update-limits`
✅ Replaces the flat +15 KB bump with a 10% buffer relative to each
plugin’s size when using `node scripts/build_kibana_platform_plugins.js
--update-limits`
✅ Updated the limits.yml with the result from the above script

## Why it matters
1. Keeps bundle sizes tight
2. Protects us from accidental regressions
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
…ic#226052)

## ✨ Summary

This PR introduces a new `openLazyFlyout` helper to improve the
**perceived performance** and **accessibility** of dashboard flyouts by
changing the interaction flow. The flow is applied for the majority of
the dashboard flyouts, but not all. The remaining work is encapsulated
in this issue: elastic#227446

### 🧠 Previous pattern

1. User clicks a button  
2. Setup logic runs (dependencies, content load)  
3. Flyout opens once ready  


![Wait](https://github.com/user-attachments/assets/52a9c2e5-cb7c-4ac7-8486-703fa5aae03a))


### ✅ New pattern

1. User clicks a button  
2. Show a loading flyout **immediately**  
3. Load the actual content **asynchronously**  
5. Replace the placeholder with real content once ready


https://github.com/user-attachments/assets/8ba5103b-a7f3-491f-a193-a5997262f4e2

---

## 📦 Key Features

- `openLazyFlyout` utility to encapsulate the new flow  
- Push-style flyouts by default (`type: 'push'`)
- Async content loading with a nice-looking skeleton loader
- Focus management:
  - Focuses first focusable element on open
  - Returns focus to `triggerId` on close
- `aria-labelledby` support for proper flyout labeling

---

## 🎯 Benefits

- **Better perceived performance and UX since the app doesn't feel jumpy
**
- **Improved accessibility** (focus handling, ARIA labeling)
- **Cleaner architecture**: encapsulated logic, reusability

---

## 🐛 Bug Fixes

This PR resolves the following issues:

Fixes elastic#225094 – 'push' flyout as a default
Fixes elastic#188575 - a long pause between clicking and showing the flyout

A11y:
Fixes elastic#214921
Fixes elastic#214505
Fixes elastic#215508
Fixes elastic#195026
Fixes elastic#215845

In addition, this PR improves many unreported accessibility issues
around focus and announcements.

---

## 📸 Visuals

Loading flyout:

<img width="401" alt="Screenshot 2025-07-08 at 15 45 59"
src="https://github.com/user-attachments/assets/e6fbdf18-d9b8-4c64-b32e-8a2f2a2b3285"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
# Summary
Hi Operations team! 👋

Recently I've worked on a
[few](elastic#227593)
[PRs](elastic#226052) that reduce our
page load bundle size, and while doing so I noticed that many of our
limits are much higher than the actual page load sizes. It made me
think: these limits should be realistic, because they’re one of the main
ways we protect page load performance.
Right now, based on the current limits, we theoretically allow up to
11,452,104 bytes (~11 MB) to load upfront. But when we check the real
page load, it’s only 5.192.979 bytes — about half of that.

We already have a `--update-limits` flag for the `node
scripts/build_kibana_platform_plugins.js --update-limits` command, but
it only bumps limits up when the size grows above the limit, adding a
flat 15 KB buffer to the bundle size.
I’d like to propose:
1. Allowing the `--update-limits` to allow folks to also lower limits
when the bundle shrinks drastically
2. Replacing the flat 15 KB buffer with 10% of the plugin’s size, so the
buffer scales realistically. Right now, with ~197 plugins,
`--update-limits` allows for an extra (15KB*197=) 3 MB above the total
page size — which is way too much in my opinion!

## What’s in this PR
✅ Adds logic to let us lower limits automatically, not just bump them up
with `node scripts/build_kibana_platform_plugins.js --update-limits`
✅ Replaces the flat +15 KB bump with a 10% buffer relative to each
plugin’s size when using `node scripts/build_kibana_platform_plugins.js
--update-limits`
✅ Updated the limits.yml with the result from the above script

## Why it matters
1. Keeps bundle sizes tight
2. Protects us from accidental regressions
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…ic#226052)

## ✨ Summary

This PR introduces a new `openLazyFlyout` helper to improve the
**perceived performance** and **accessibility** of dashboard flyouts by
changing the interaction flow. The flow is applied for the majority of
the dashboard flyouts, but not all. The remaining work is encapsulated
in this issue: elastic#227446

### 🧠 Previous pattern

1. User clicks a button  
2. Setup logic runs (dependencies, content load)  
3. Flyout opens once ready  


![Wait](https://github.com/user-attachments/assets/52a9c2e5-cb7c-4ac7-8486-703fa5aae03a))


### ✅ New pattern

1. User clicks a button  
2. Show a loading flyout **immediately**  
3. Load the actual content **asynchronously**  
5. Replace the placeholder with real content once ready


https://github.com/user-attachments/assets/8ba5103b-a7f3-491f-a193-a5997262f4e2

---

## 📦 Key Features

- `openLazyFlyout` utility to encapsulate the new flow  
- Push-style flyouts by default (`type: 'push'`)
- Async content loading with a nice-looking skeleton loader
- Focus management:
  - Focuses first focusable element on open
  - Returns focus to `triggerId` on close
- `aria-labelledby` support for proper flyout labeling

---

## 🎯 Benefits

- **Better perceived performance and UX since the app doesn't feel jumpy
**
- **Improved accessibility** (focus handling, ARIA labeling)
- **Cleaner architecture**: encapsulated logic, reusability

---

## 🐛 Bug Fixes

This PR resolves the following issues:

Fixes elastic#225094 – 'push' flyout as a default
Fixes elastic#188575 - a long pause between clicking and showing the flyout

A11y:
Fixes elastic#214921
Fixes elastic#214505
Fixes elastic#215508
Fixes elastic#195026
Fixes elastic#215845

In addition, this PR improves many unreported accessibility issues
around focus and announcements.

---

## 📸 Visuals

Loading flyout:

<img width="401" alt="Screenshot 2025-07-08 at 15 45 59"
src="https://github.com/user-attachments/assets/e6fbdf18-d9b8-4c64-b32e-8a2f2a2b3285"
/>

---------

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:skip This PR does not require backporting Feature:Drilldowns Embeddable panel Drilldowns Feature:Embedding Embedding content via iFrame release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.2.0

10 participants