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

feat: show more information when loading chart #27255

Merged
merged 5 commits into from
Mar 11, 2024
Merged

feat: show more information when loading chart #27255

merged 5 commits into from
Mar 11, 2024

Conversation

betodealmeida
Copy link
Member

SUMMARY

This PR adds text to the chart spinner, informing the user:

  1. When data is fetching fetched from the database (and which database)
  2. When the chart is being rendered

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Dashboards:

Screenshot 2024-02-26 at 15-00-00 Spinner test

Screenshot 2024-02-26 at 15-00-14 Spinner test

Charts:

Screenshot 2024-02-26 at 15-00-24 Superset

Screenshot 2024-02-26 at 15-00-45 Superset

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 67.35%. Comparing base (00b47ab) to head (8916010).
Report is 79 commits behind head on master.

Files Patch % Lines
superset-frontend/src/components/Chart/Chart.jsx 81.81% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27255      +/-   ##
==========================================
+ Coverage   67.22%   67.35%   +0.12%     
==========================================
  Files        1905     1909       +4     
  Lines       74577    74557      -20     
  Branches     8338     8325      -13     
==========================================
+ Hits        50138    50218      +80     
+ Misses      22389    22288     -101     
- Partials     2050     2051       +1     
Flag Coverage Δ
javascript 57.21% <81.81%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -232,16 +246,51 @@ class Chart extends React.PureComponent {
);
}

renderSpinner(chartStatus, databaseName) {
const messages = {
loading: t('Fetching data from %s', databaseName),
Copy link
Member

@mistercrunch mistercrunch Feb 28, 2024

Choose a reason for hiding this comment

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

Not sure if we got design input here, but maybe we want to make it more clear that we're waiting for the database to do its job. There's always been this perception of "superset is slow" when in fact it's the underlying datastore that we're waiting on. "Fetching" is an active word and makes it sounds like Superset is the [slow] actor. Maybe a more passive message like "Querying Presto" or "Waiting on Presto...". @kasiazjc

Also curious if this is still an overlay (I think previously was transparent?) or just a opaque thing? Maybe a nice effect/animation would be slick here (?) I'm generally not too big on animation, but since this is so common and visible, it may make sense to have something subtle and sharp-looking here.

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 a great point, and makes all the difference!

Copy link
Member

Choose a reason for hiding this comment

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

Agree with @mistercrunch here. A passive message will help improve Superset's performance perception.

@michael-s-molina
Copy link
Member

/testenv up

errorMessage,
chartIsStale,
queriesResponse = [],
width,
} = this.props;
const databaseName = datasource?.database?.name;
Copy link
Member

Choose a reason for hiding this comment

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

According to Typescript the datasource/database can be undefined which will show in the interface. Can we handle this case?

Copy link
Member

@michael-s-molina michael-s-molina Feb 28, 2024

Choose a reason for hiding this comment

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

Maybe use "Waiting on database..." when the database name is not available.

Copy link
Contributor

@michael-s-molina Ephemeral environment spinning up at http://34.216.78.0:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@michael-s-molina
Copy link
Member

Not in the scope of this PR but related. Should we make the same change on SQL Lab for the queries? @justinpark for awareness.

)}
</div>
{isLoading && <Loading />}
{isLoading
Copy link
Member

Choose a reason for hiding this comment

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

const isLoading = chartStatus === 'loading';

This means that this.renderSpinner(chartStatus, databaseName) will never be called with another status which makes the other status messages irrelevant. I think having only 'Waiting on {database}' is sufficient.

Copy link
Member Author

Choose a reason for hiding this comment

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

D'oh, you're right, let me fix this. Thanks!

@yousoph
Copy link
Member

yousoph commented Mar 11, 2024

/testenv up

Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://18.246.149.129:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

Looks great @betodealmeida!

@betodealmeida betodealmeida merged commit fbc8943 into master Mar 11, 2024
27 checks passed
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@rusackas rusackas deleted the sc-75386 branch March 12, 2024 00:26
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 14, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 19, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 22, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 26, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Mar 28, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 1, 2024
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 2, 2024
betodealmeida added a commit that referenced this pull request Apr 25, 2024
qleroy pushed a commit to qleroy/superset that referenced this pull request Apr 28, 2024
eschutho pushed a commit that referenced this pull request Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants