Skip to content

[Dashboard] Fetch only visible panels#225372

Draft
ThomThomson wants to merge 24 commits intoelastic:mainfrom
ThomThomson:dashboard/fetchOnlyVisible
Draft

[Dashboard] Fetch only visible panels#225372
ThomThomson wants to merge 24 commits intoelastic:mainfrom
ThomThomson:dashboard/fetchOnlyVisible

Conversation

@ThomThomson
Copy link
Contributor

@ThomThomson ThomThomson commented Jun 25, 2025

Summary

Closes #150459

This PR removes the Labs concept from Dashboard and Canvas, as well as deleting all related code.

This PR also migrates the useful setting, deferBelowFold to a Dashboard-level setting which is on by default for new Dashboards, and off by default for existing Dashboards to avoid unwanted changes.

This new setting works by allowing panels to become initialized when they are off screen, but delaying the data-fetch until they enter the viewport. This is a more robust solution which allows for all related code to be pre-loaded, but delays performance heavy data fetching and rendering.

Note for Data-Discovery reviewers

The delay to fetching works by injecting a pauseFetch$ stream into the API when it's finalized. The Discover Session embeddable started the data fetch process before finalizing the API, so that code has been moved.

@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-renovate-helper for this PR!

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@ThomThomson
Copy link
Contributor Author

/ci

@elasticmachine
Copy link
Contributor

elasticmachine commented Sep 8, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #66 / dashboard app - group 4 dashboard listing page edit meta data saves changes to dashboard metadata
  • [job] [logs] FTR Configs #66 / dashboard app - group 4 dashboard listing page edit meta data saves changes to dashboard metadata
  • [job] [logs] FTR Configs #120 / dashboard app - group 6 dashboard grid move panel Can move panel from bottom to top row
  • [job] [logs] FTR Configs #120 / dashboard app - group 6 dashboard grid move panel Can move panel from bottom to top row
  • [job] [logs] FTR Configs #117 / dashboard custom time range by value can remove a custom time range from a panel
  • [job] [logs] FTR Configs #117 / dashboard custom time range by value can remove a custom time range from a panel
  • [job] [logs] FTR Configs #39 / machine learning - anomaly detection anomaly charts in dashboard with multi metric job create new anomaly charts panel
  • [job] [logs] FTR Configs #39 / machine learning - anomaly detection anomaly charts in dashboard with multi metric job create new anomaly charts panel
  • [job] [logs] Scout: [ platform / discover_enhanced ] plugin / serverless-oblt - Discover app - saved searches - should customize time range on dashboards
  • [job] [logs] Scout: [ platform / discover_enhanced ] plugin / serverless-search - Discover app - saved searches - should customize time range on dashboards
  • [job] [logs] Scout: [ platform / discover_enhanced ] plugin / stateful - Discover app - saved searches - should customize time range on dashboards
  • [job] [logs] FTR Configs #13 / X-Pack Accessibility Tests - Group 3 machine learning embeddables anomaly charts Accessibility with multi metric job create new anomaly charts panel
  • [job] [logs] FTR Configs #13 / X-Pack Accessibility Tests - Group 3 machine learning embeddables anomaly charts Accessibility with multi metric job create new anomaly charts panel

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 603 606 +3
apm 1989 1992 +3
cases 1157 1160 +3
controls 396 399 +3
dashboard 693 696 +3
dashboardEnhanced 124 127 +3
dashboardMarkdown 102 105 +3
dataVisualizer 763 766 +3
discover 1488 1491 +3
discoverEnhanced 85 88 +3
embeddable 110 113 +3
embeddableAlertsTable 520 523 +3
embeddableEnhanced 84 87 +3
imageEmbeddable 159 162 +3
inputControlVis 109 112 +3
lens 1414 1417 +3
links 136 139 +3
maps 1284 1287 +3
ml 2515 2518 +3
presentationPanel 156 160 +4
presentationUtil 105 96 -9
reporting 227 230 +3
securitySolution 7935 7938 +3
slo 1248 1251 +3
synthetics 1352 1355 +3
triggersActionsUi 971 974 +3
urlDrilldown 87 90 +3
visTypeVega 567 570 +3
visualizations 542 545 +3
total +76

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/management-settings-ids 133 130 -3
@kbn/presentation-publishing 230 247 +17
presentationUtil 82 29 -53
total -39

Async chunks

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

id before after diff
aiops 517.9KB 518.6KB +779.0B
canvas 1.1MB 1.1MB -881.0B
cases 1.4MB 1.4MB +6.0B
controls 485.0KB 485.1KB +61.0B
dashboard 623.1KB 623.7KB +682.0B
dashboardEnhanced 66.6KB 66.6KB +6.0B
dashboardMarkdown 71.2KB 71.2KB +6.0B
dataVisualizer 683.8KB 684.5KB +782.0B
discover 1.1MB 1.1MB +784.0B
embeddableAlertsTable 940.5KB 941.2KB +785.0B
imageEmbeddable 111.7KB 111.7KB +6.0B
lens 1.5MB 1.5MB +2.0B
links 100.7KB 100.7KB +6.0B
maps 3.1MB 3.1MB +1.1KB
ml 5.4MB 5.4MB +779.0B
presentationPanel 99.0KB 99.7KB +673.0B
presentationUtil 67.4KB 57.3KB -10.1KB
reporting 181.3KB 181.3KB +1.0B
securitySolution 10.3MB 10.3MB +8.0B
slo 974.2KB 975.0KB +787.0B
synthetics 1.0MB 1.0MB +775.0B
visualizations 351.5KB 352.3KB +775.0B
total -2.3KB

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
presentationUtil 5 4 -1

Page load bundle

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

id before after diff
canvas 13.6KB 13.6KB -9.0B
dashboard 18.0KB 17.9KB -87.0B
dataVisualizer 26.4KB 26.4KB -1.0B
embeddable 17.1KB 17.4KB +281.0B
lens 60.9KB 61.6KB +711.0B
presentationUtil 8.3KB 5.6KB -2.8KB
reporting 41.5KB 41.5KB +1.0B
visualizations 37.8KB 37.8KB -4.0B
total -1.9KB
Unknown metric groups

API count

id before after diff
@kbn/management-settings-ids 134 131 -3
@kbn/presentation-publishing 276 294 +18
presentationUtil 108 52 -56
total -41

async chunk count

id before after diff
presentationUtil 10 8 -2

ESLint disabled line counts

id before after diff
presentationUtil 11 9 -2

Total ESLint disabled count

id before after diff
presentationUtil 11 9 -2

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Replace labs:dashboard:deferBelowFold advanced setting with dashboard option

4 participants