-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Improve Embeddable loading and error handling UI #68623
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
Improve Embeddable loading and error handling UI #68623
Conversation
Gray out loading \ errored results
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
…ize-embeddable-error-handling
src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx
Outdated
Show resolved
Hide resolved
src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx
Outdated
Show resolved
Hide resolved
| this.handler = new expressions.ExpressionLoader(this.domNode); | ||
| this.handler = new expressions.ExpressionLoader(this.domNode, '', { | ||
| onRenderError: (element: HTMLElement, error: RenderError) => { | ||
| this.onContainerError(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't test yet, but I wonder:
considering very recent fixes around race conditions in this file, could this callback become another source for possible race condition?
Like for example: there is already a new request finished and new vis rendered, but somehow error from previous request popped up and replaced actual visualization with older error?
There are some checks happening in updateHander, but it relies on reference to older abort controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This callback is called exactly the same way it was previously - just with different UI logic.
See src/plugins/expressions/public/render.ts line 68.
We used to use defaultRenderErrorHandler before, and it would output the errors as toasts. Since we now pass a custom error handler - it gets called instead when an error occurs.
There are no other changes in flow. I just extracted the state handling into meaningful callbacks to make it more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a slight difference:
- Previously we just showed a popup on the right and error didn't affect the visualisation embeddable.
- Now if older error pops up we will show "error" label near the visualisation in actual state.
I still haven't reproduced what I am worrying about here :(
Just being extra cautions because of recent experience with cancelations :(
Don't have a particular action item here now
|
Is this graying out change OK from a11y perspective? Maybe someone have to look at it if haven't yet?
On a dashboard only visualizations will use this |
| }; | ||
|
|
||
| onContainerError = (error: RenderError) => { | ||
| if (this.abortController) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to: https://github.com/elastic/kibana/pull/68623/files#r437278595
I guess here could be a race condition, that when error pops up, this.abortController is actually an abortController for new on-going request which haven't finished yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The graying out will actually prevent the user from applying a filter while another search is running, reducing the chances of this happening.
|
@elasticmachine merge upstream |
src/plugins/visualizations/public/embeddable/embeddable_error_label.tsx
Outdated
Show resolved
Hide resolved
|
The general rule of thumb with a11y is that if something is disabled (can’t interact with it) or in this case doesn’t actually represent any (current) data, you don’t really need to adhere to contrast levels. Though we tend to try to ensure at least a 2.0 ratio. As long as there is an indicator as to why there’s no content or grayed content, such as your label, it should be ok for a11y with regards to color. What you might need to look into is ensuring that for screen-readers, it is announced appropriately as either loading, incomplete, or has error. |
…ize-embeddable-error-handling
cchaos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise this LGTM, but I'm going to defer the design review to @mdefazio.
|
Design looks good. I think one update we need to look into is also dimming the title as well. For non-visual panels, there won't be any difference between loading/loaded. So the idea is that this would help here. I don't know that there is enough difference with the Text Dark shade, so I think I'd try |
Integrate with search embeddable
mdefazio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design LGTM!
…ize-embeddable-error-handling
…ize-embeddable-error-handling
|
@elasticmachine merge upstream |
ThomThomson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's especially nice is the instant feedback given on user action. The greyed out chart/title says "I'm working, give me a second" which makes everything feel snappier.
One thing to consider though, are situations in which the embeddable panel might be loading, but not because of direct user action. Such as an auto-refresh. In some use-cases, it's just expected that the data is up to date, and a distinct loading state just adds noise.
Not urgent, and shouldn't get in the way of merging this, but I wonder if it would be worth adding some kind of tag that determines when to show the loading state.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Add error label on visualize embeddable error Gray out loading \ errored results * Translate label * code review * Rename ExpressionRenderError, better scss * oopsy * Generalize solution to be used by other embeddables * Cleanup * css fix * Move wrapper div into label component * Lighten panel title while loading Integrate with search embeddable * translations * Error notification in visualize app * Update render count on error Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Add error label on visualize embeddable error Gray out loading \ errored results * Translate label * code review * Rename ExpressionRenderError, better scss * oopsy * Generalize solution to be used by other embeddables * Cleanup * css fix * Move wrapper div into label component * Lighten panel title while loading Integrate with search embeddable * translations * Error notification in visualize app * Update render count on error Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
|
Hi Team, In which stable version this issue fixed. we are using 7.9.3 and facing same issue. Looking for prompt response . |
|
Hi @piyushabad88, looks like it's released on 7.9 at least. Is your issue related to #71369 or #82110?
|
|
… On Tue, Feb 16, 2021 at 3:00 PM Marco Vettorello ***@***.***> wrote:
Hi @piyushabad88 <https://github.com/piyushabad88>, looks like it's
released on 7.9 at least. Is your issue related to #71369
<#71369> or #82110
<#82110>?
If not please can you open a GH issue linking to this PR? thanks
cc @lizozom <https://github.com/lizozom>
Hi Team,
In which stable version this issue fixed. we are using 7.9.3 and facing
same issue. Looking for prompt response .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68623 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGNFR2FUO3GYRC6DGQTJ6N3S7I3MTANCNFSM4NZF4PZQ>
.
|
Summary
This PR is an enhancement based on @mdefazio mocks for Make it Slow.
In
visualize_embeddableandsearch_embeddableUI, we now:Erroror aAbortedlabel to each visualization. Users can simply use the back button if they wish to return to the old search config.Note that other app behavior did not change and still shows an error toast notification in discover and visualize.
These changes can be easily applied to other embeddables (Lens @elastic/kibana-app and Maps @elastic/kibana-gis for example) to create a uniform user experience. This can be achieved by using the embeddable's output and setting it to:
this.updateOutput({ loading: true, error: undefined });this.updateOutput({ loading: false, error: undefined });this.updateOutput({ loading: false, error });Added benefits
search_interceptor, but the expression'sAbortControlleris not cancelled properly (it didn't have any implications ATM, but would have them with Make it Slow).Checklist
Delete any items that are not applicable to this PR.
For maintainers