grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
133 stars 20 forks source link

SceneQueryRunner: Act as if we're loading when waiting for variables to load. #768

Closed oscarkilhed closed 3 months ago

oscarkilhed commented 3 months ago

When a scene loads and VizPanels with variable dependencies are waiting to load, there's no indication that the panel will eventually load.

This PR sets the state of the PanelData to loading when we're waiting for the variable dependencies.

Fixes: https://github.com/grafana/grafana/issues/84574

One could argue that setting the LoadingState to "NotStarted" or introducing a new state called "WaitingForDependency" would make more sense. But it would also introduce a lot more changes to grafana as a whole.

Before (notice the loading indicator on the panel chrome is not running before the variable is loaded): loading-before

After: loading-after

torkelo commented 3 months ago

been thinking about doing this change for the last couple of months, I think it's the right thing to do. Maybe add a unit test?

oscarkilhed commented 3 months ago

@torkelo yeah, I need to change the way the unit tests detect if we're making a query as well. Will add tests for this as part of that

grafanabot commented 3 months ago

:rocket: PR was released in v4.26.2 :rocket: