elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.48k stars 8.04k forks source link

Wire up `Charts` to the correct dark-mode theme #172385

Open nickofthyme opened 7 months ago

nickofthyme commented 7 months ago

Kibana version:

main

Describe the bug:

Several usages (39 to be exact) of the @elastic/charts Chart component are not correctly tied to the dark-mode-specific base theme. This leads to bad colors in these charts and issues when upgrading/changing chart themes.

An example of this is like below, where the chart consumer uses the Settings spec but does not supply any baseTheme so chart defaults to using the LIGHT_THEME.

https://github.com/elastic/kibana/blob/eac36e8024db3f3048d74dd9e3f1eff6196177dd/x-pack/plugins/ml/public/application/memory_usage/nodes_overview/memory_preview_chart.tsx#L119-L123

List of bad usages

Expected behavior:

All charts should be wired up the the correct dark-mode-specific theme.

Any additional context:

This is only a temporary fix as people that come along and add new charts could create more usages like this. To future proof this issue and prevent this from happening again, we can do something like https://github.com/elastic/kibana/pull/114839.

cc: @markov00 & @gvnmagni

elasticmachine commented 7 months ago

Pinging @elastic/kibana-visualizations (Team:Visualizations)