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

[Lens] Show loading icon for suggestions immediately #61782

Closed
timroes opened this issue Mar 30, 2020 · 6 comments
Closed

[Lens] Show loading icon for suggestions immediately #61782

timroes opened this issue Mar 30, 2020 · 6 comments
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure usability

Comments

@timroes
Copy link
Contributor

timroes commented Mar 30, 2020

Currently when changing the configuration the suggestion panels will still show the old suggestions until the new ones has been rendered. We should immediately switch into showing a loading state (e.g. Gray bars) as soon as the configuration has changed.

@timroes timroes added Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure usability labels Mar 30, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon
Copy link
Contributor

I agree with this issue, and previously tried to get this behavior to happen while making changes to the ReactExpressionRenderer component, since I added the loading states in the first place. The reason we don't have this behavior is that we are using events from the search source, which introduces an artificial delay, and the artificial delay is what you are noticing.

The potential solutions are:

  • Stop using ReactExpressionRenderer, replace it with something that we control
  • Change ReactExpressionRenderer to show a loading spinner before the network request starts. @streamich previously pushed back on this change, when I tried it.
  • Look for a way to remove the fetchSoon behavior which introduces artificial delay to requests. @lukasolson or @elastic/kibana-app-arch would be best for this.

@lukasolson
Copy link
Member

Currently, when courier:batchSearches is set to true, we introduce this delay to batch up searches in a single _msearch call. That will be going away entirely in 8.0 (see #55140).

In the short term, we are planning on isolating fetchSoon and the branch of code relating to _msearch and courier:batchSearches and removing the delay when it is not set to true (see #61739).

@wylieconlon
Copy link
Contributor

@lukasolson Thanks for the clarification. The work you've described of moving fetchSoon into a branch of the code should solve this issue as well.

@flash1293 flash1293 added the enhancement New value added to drive a business result label Aug 6, 2020
@flash1293
Copy link
Contributor

I think the very noticeable delay here isn't caused by the fetch delay, but by the debouncing of the suggestions (which makes sense) and using index as key: https://github.com/flash1293/kibana/blob/4a1b05c843c39beb3ea2d4db35f444e4b120c428/x-pack/plugins/lens/public/editor_frame_service/editor_frame/suggestion_panel.tsx#L329

By using a more unique key here, we should be able to improve the situation a lot.

@flash1293
Copy link
Contributor

Fixed in master - it's now immediately showing a loading bar on user interaction, updating the chart once the data arrives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure usability
Projects
None yet
Development

No branches or pull requests

5 participants