Page MenuHomePhabricator

Loading indicator for search results
Closed, ResolvedPublic

Description

Section Translation supports searching for an article to start a translation. In the search step, when typing the search query results take some time to load. This is a brief but noticeable delay on a fast network but could represent a longer waiting period on other networks.

This ticket proposes to show the loading indicator component in the search results area until the results are loaded.

The screenshot below captures the moment after typing a couple characters before the results are shown:

typing without results.png (1×720 px, 64 KB)

Event Timeline

Change 694365 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SXArticleSearch: Add loading spinner during result fetching

https://gerrit.wikimedia.org/r/694365

Change 694365 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SXArticleSearch: Add loading spinner during result fetching

https://gerrit.wikimedia.org/r/694365

Jpita subscribed.

currently, once we get a first set of results, when we type another character and wait for a second set of results, we can still see and interact with the first set of results.
Is this expected or should we delete the first set of results once we search for another query?

image.png (576×706 px, 90 KB)

I've trying the current status and the movement of the content causes some distraction. Especially when typing a query that is refining the existing results, as opposed to showing a complete new set. In such context the article you are trying to select keeps jumping up and down as you type.

I'd propose the following adjustments:

  • Show the loading indicator only if one second has passed since the user types. One second is about the limit for the user's flow of thought to stay uninterrupted. If the new results update after a second, there is no need to show the loading indicator. The old results are kept and instantly replaced with the new ones.
  • Clear the results when showing the loading indicator. After a second, the old results are cleared and the loading indicator is shown until the new results are displayed.

With all kinds of networks and devices, glitches are still possible, but overall I expect the above approach to feel more fluent most of the time.

If the above is non-trivial, we can discuss which parts to cover as part of the current ticket and which ones to create as a follow-up.

  • Show the loading indicator only if one second has passed since the user types

this one seems to be done already

  • Clear the results when showing the loading indicator

missing

Change 700941 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] SX Article Search: Hide results when loading indicator is shown

https://gerrit.wikimedia.org/r/700941

Change 700941 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX Article Search: Hide results when loading indicator is shown

https://gerrit.wikimedia.org/r/700941