Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dashboard] fix <Loading /> spinners disappear too early #6283

Merged
merged 1 commit into from Nov 6, 2018

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Nov 6, 2018

Recently I noticed that loading spinners on dashboards would disappear
too early. @kristw @williaster
gnnryhxtfj

Recently I noticed that loading spinners on dashboards would disappear
too early.
@@ -176,7 +176,7 @@ class Chart extends React.PureComponent {
>
{this.renderTooltip()}

{isLoading && <Loading size={50} />}
{chartStatus !== 'rendered' && <Loading size={50} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

How about updating the definition of isLoading on line 164?

from

const isLoading = chartStatus === 'loading';

to

const isLoading = chartStatus !== 'rendered';

Copy link
Member Author

Choose a reason for hiding this comment

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

That's what I tried at first, but that broke things, looks like it has to do with the skipChartRendering-related logic

Copy link
Member Author

Choose a reason for hiding this comment

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

Variable-naming-wise isLoading = chartStatus === 'loading' makes more sense than isLoading = chartStatus !== 'rendered', so I want to stick with it.

The confusion is more around the component being called <Loading /> which should be shown while the component is still either loading (async call) or rendering (waiting for browser's attention).

Copy link
Contributor

Choose a reason for hiding this comment

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

got it.

Copy link
Contributor

Choose a reason for hiding this comment

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

you could possibly add a new variable that makes this more readable const showLoader = chartStatus !== 'rendered'.

This is an interesting observation tho, I think it just shows that the chart rendering is actually really slow, esp for certain vis types and when you are loading a dashboard because there are a HUGE amount of DOM changes/additions. Theoretically the rendering is starting at the same time we were previously hiding the Loader ...

@codecov-io
Copy link

codecov-io commented Nov 6, 2018

Codecov Report

Merging #6283 into master will increase coverage by 0.1%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #6283     +/-   ##
=========================================
+ Coverage   76.91%   77.01%   +0.1%     
=========================================
  Files          64       64             
  Lines        9508     9508             
=========================================
+ Hits         7313     7323     +10     
+ Misses       2195     2185     -10
Impacted Files Coverage Δ
superset/connectors/sqla/models.py 80.56% <0%> (+0.74%) ⬆️
superset/db_engine_specs.py 55.03% <0%> (+0.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c653ab1...1f18528. Read the comment docs.

@mistercrunch mistercrunch merged commit a1d867c into apache:master Nov 6, 2018
@mistercrunch mistercrunch deleted the fix_dash_spinner branch November 6, 2018 16:51
@graceguo-supercat
Copy link

graceguo-supercat commented Nov 6, 2018

@mistercrunch @kristw no data or other error will cause spinner running forever...

@kristw
Copy link
Contributor

kristw commented Nov 6, 2018

Oh...

@mistercrunch
Copy link
Member Author

Let me do another take on this.

mistercrunch added a commit to mistercrunch/superset that referenced this pull request Nov 7, 2018
Addressing post-merge comments in
apache#6283
mistercrunch added a commit that referenced this pull request Nov 7, 2018
Addressing post-merge comments in
#6283
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this pull request Dec 26, 2018
Recently I noticed that loading spinners on dashboards would disappear
too early.
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this pull request Dec 26, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants