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

Improved Dashboard Error Feedback #7427

Merged
merged 9 commits into from
Dec 1, 2021
Merged

Improved Dashboard Error Feedback #7427

merged 9 commits into from
Dec 1, 2021

Conversation

pauldambra
Copy link
Member

Changes

Closes #6285

This introduces three changes

  1. makes the loading overlay for insights less subtle so loading is easier to see on slow connections
  2. adds an error state for individual insights on a dashboard to distinguish from their empty state
  3. adds an error state for an entire dashboard to distinguish from its empty state

before loading change

before

after loading change

after

whole dashboard error

before

Screenshot 2021-11-30 at 12 14 46

after

Screenshot 2021-11-30 at 12 06 12

individual item errors

#### before

Screenshot 2021-11-30 at 12 16 09

after

Screenshot 2021-11-30 at 11 58 55

How did you test this code?

with some unit tests and manual testing

in order to test manually the easiest route is to load a dashboard then run redis-cli KEYS "*cache*" | xargs redis-cli DEL so the cache for the items is removed and then insert a throw in either the dashboardLogic > loaders > allItems to dashboardLogic > refreshAllDashboardItems > fetchItemFunctions depending on if you want to error on all items or individual items respectively then either refresh the page or click to refresh the dashboard

@pauldambra pauldambra requested review from clarkus and Twixes November 30, 2021 12:43
Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Big improvement. Code looks good, just some notes on the UI

Comment on lines 783 to 805
.loading-overlay {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: $bg_charcoal;
text-align: center;
min-height: 6rem;
opacity: 0.7;
z-index: $z_content_overlay;
display: flex;
align-items: center;
justify-content: center;

&.over-table {
display: block;
background: rgba(0, 0, 0, 0.1);
td {
display: block;
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Why the move from style.scss?

Copy link
Member Author

Choose a reason for hiding this comment

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

The file is listed as deprecated so I thought better not to edit

if (showErrorMessage) {
return <InsightErrorState />
if (showErrorMessage || receivedErrorFromAPI) {
return <InsightErrorState excludeDetail={true} />
Copy link
Member

Choose a reason for hiding this comment

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

InsightErrorState's gray background makes sense in the larger size (excludeDetail={false}) but here it looks kind of sloppy:
144045452-e10f5c2f-fde0-42b5-a589-27f35e86ecb3 (1)
I'm going to rely on @clarkus's skills to suggest the better way though.

Copy link
Contributor

Choose a reason for hiding this comment

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

These errors states do look a little cramped. If we retain the gray background, we should pad the container a bit more. If it's feasible to drop the gray background and reuse colors from the dashboard item color styles, then we wouldn't need to change padding. Put together a quick example:
Frame 9192

frontend/src/styles/global.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@clarkus clarkus left a comment

Choose a reason for hiding this comment

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

Solid improvements! Left some examples to guide feedback, but I don't see anything blocking from a UX point of view. Nice job, @pauldambra

@pauldambra
Copy link
Member Author

spinner with just background opaquified

2021-11-30 18 49 24

error state matching the container

error-states

@pauldambra pauldambra requested a review from Twixes November 30, 2021 18:53
@mariusandra
Copy link
Collaborator

Not a review, but a comment that it would be awesome to (somehow? eventually?) see all these different states, with all the available colors somewhere on a storybook. I started something like this in #7017, but it got stalled.

Here's the storybook page as it is in that PR. The next steps is to add all the different types of charts with some real-ish data by copying a few API responses into json files. The step after that is to add other stories where all the charts show a specific state (loading, error, timeout, etc).

I'd be happy if someone could pick that up. 🤞

Copy link
Member

@Twixes Twixes 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. One styling comment

Comment on lines +324 to +340
&.purple {
.insight-empty-state {
&.match-container {
&.error {
.illustration-main {
color: $text_light;
}

h2 {
color: $text_light;
}
}
}
}
}

&:not(.purple) {
Copy link
Member

Choose a reason for hiding this comment

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

Hm, not sure about giving just purple special handling here - maybe all non-white should have this styling?

Copy link
Member Author

Choose a reason for hiding this comment

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

I might pick up the storybook as described above then. Can check which colours do or don't work with white text then

@pauldambra pauldambra merged commit df88b7d into master Dec 1, 2021
@pauldambra pauldambra deleted the dashboard_errors branch December 1, 2021 14:30
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 (or insight) fails to load
4 participants