Page MenuHomePhabricator

Allow custom message instead of "No results found" in ULS for special scenarios
Open, MediumPublic

Description

When there are no search results in ULS, "No results found" is always shown.

It may show a more specific message in some scenarios. Most notably, in compact language links, it may say something like "This article is not available in the language for which you're searching" (suggestions from Design people for better wording are welcome).

As an idea for a longer term improvement, if a language name is found, but there is no article in that language, it may invite the user to write the article, similarly to Content Translation's entry point. But as a first step, a custom "No results" message will suffice.

Example of messages to show in each case

  1. Language search API finds one or more matches, and at least one of those is in the list of languages available
    • No error message is shown, the matches in the languages available are shown in the results.
  2. Language search API finds exactly one match, but none of those are in the list of languages available
    • Message: "Page not available in <language-name>"
  3. Language search API finds more than one match, but none of those are in the list of languages available
    • Message: "This page is not available in the language you searched for"
  4. Language search API finds no matches.
    • Message: "No results found"

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Amire80 triaged this task as High priority.Dec 18 2017, 7:30 PM

Change 404234 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls to fd41bbe

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

Change 404234 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Update jquery.uls to d122f37

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

This case will follow a similar structure to the "No message found" message, where a message is shown and alternative languages are provided as a follow-up for the user.

The message to be shown in this case would be "Page not available in <language-name>". The "language-name" displays the autonym in grey (Base30, #72777D) to communicate that the language that is missing. This is illustrated below:

lang-select-not-avail.png (852×906 px, 83 KB)

Showing the language that the user is searching for is useful as an explicit confirmation. If showing the language name is technically complex, a more generic message can be used ("This page is not available in the language you searched for"), as illustrated below:

lang-select-not-avail-alt.png (852×906 px, 88 KB)

Implementation thoughts: we can show this message when search API returns results, but none of them match what is in the list. We can pick up the language name from the search API result.

Implementation thoughts: we can show this message when search API returns results, but none of them match what is in the list. We can pick up the language name from the search API result.

@Nikerabbit Can you elaborate? by "show this message", which message you mean? May be an example also help

This message = "This page is not available in language X" as opposed to the generic "no results" message.

Change 408968 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/UniversalLanguageSelector@master] Custom no-results message for compact links search

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

@Pginer-WMF Can you clarify the expectations.

There are different cases here:

  1. Language search API finds one or more matches, and at least one of those is in the list of languages available
  2. Language search API finds exactly one match, but none of those are in the list of languages available
  3. Language search API finds more than one match, but none of those are in the list of languages available
  4. Language search API finds no matches.

1 is clearly out of scope, as we do not show any message

Current patch groups 2-4 into together and always displays the custom message without language as in your screenshot.

My understanding is that we would keep the regular message for case 4 and display the custom message for cases 2 and 3. Implementing this would require some more work (but would also likely make us able to display the language name too).

Questions:

  • Should we go forward with this patch as is?
  • If so, should we create another one to separate cases 2-3 from 4.
  • If not, should we make it as I described above, or are there some things to do differently, like handling cases 2 and 3 differently?

To help, here is the screenshot from the current patch( which is simple approach I followed so that we get an idea for further improvements if any)

image.png (584×450 px, 104 KB)

@Pginer-WMF Can you clarify the expectations.
My understanding is that we would keep the regular message for case 4 and display the custom message for cases 2 and 3. Implementing this would require some more work (but would also likely make us able to display the language name too).

This is correct. The main purpose of the ticket is to distinguish between (a) the content not being available for a language the user searches and (b) not being able to identify which language the user is searching in. You provided two different cases of (a) for which makes sense to have different messages too.

Questions:

  • Should we go forward with this patch as is?

To communicate the different cases we need to either do improvements on the current patchset or as follow-up patchsets. I'm ok with either, what makes more sense technically.

  • If so, should we create another one to separate cases 2-3 from 4.
  • If not, should we make it as I described above, or are there some things to do differently, like handling cases 2 and 3 differently?

Separating the cases 2-3 ("Page not available in <language-name>") from 4 ("No results found") is the minimum requirement. On top of that, it would be good to further distinguish case 2 ("Page not available in <language-name>") from case 3 ("This page is not available in the language you searched for").

I updated the ticket description to show the message for each case.

NOTE: (Technical) Currently jquery.uls library has a no-results handler with no extra information. Addressing second, third cases of this ticket will require no-results handler getting the information about search API results. Whether the search API result returned one result or more than once, Also, if it is one result, that result as well. So, this will require some refactoring at jquery.uls upstream, most probably adding additional method parameters for searchAPI hander and no-results rendering handler.

Examining the suggestions from the task description:

  1. Language search API finds one or more matches, and at least one of those is in the list of languages available No error message is shown, the matches in the languages available are shown in the results.

If I'm not mistaken, this has been the behavior for a long time, and this is OK.

  1. Language search API finds exactly one match, but none of those are in the list of languages available Message: "Page not available in <language-name>"
  2. Language search API finds more than one match, but none of those are in the list of languages available Message: "This page is not available in the language you searched for"

This is good. Suggestion #2 is very nice, but if #2 is very complicated, it's OK to merge it with #3 for now. Implementing #2 is not a blocker for further deployment.

  1. Language search API finds no matches. Message: "No results found"

If it's complicated to know whether there are no results because the article is not available or because the language name was not found by the API, it's OK to say that same thing as in #3 for now. Also not a blocker for further deployment.

When we are in the Compact Language Links panel, it must say "This page is not available in the language you searched for". In other ULS panel it's OK to say just "No results found".

Change 408968 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Custom no-results message for compact links search

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

@Etonkovidova when doing QA on this ticket, notice that the scope has changed. What was done is to show the "This page is not available in the language you searched for" when the user searches for a non existing language and when the user searches for a language in which the content is not available. As future steps, work will be done to differentiate both cases.

Checked in cawiki (wmf.21) - the new message generally looks and works as expected.
Presently, the message, as it was pointed out, does not differentiate between the non-exisitng-in-the-list language entered and the case when the article does not exists in the language (##2-4 cases display the same message).

However, @Pginer-WMF - please review the following to confirm that the behavior is ok.
(1) Different popups are displayed depending on how many languages are available. If many languages are available, the popup will look like this:

Screen Shot 2018-02-15 at 12.17.43 PM.png (464×853 px, 92 KB)

If just few languages are available the popup looks as the following ( I filed the issue with vertical scrolling as T187508: Compact language links popup vertical scrollbar takes the whole vertical space) :

Screen Shot 2018-02-15 at 11.54.49 AM.png (348×390 px, 42 KB)

(2) Another interesting case - when the number of language links is small (3-4) - then the message "This page is not available in ..." is dispalyed without suggestions.

Screen Shot 2018-02-15 at 12.15.52 PM.png (508×516 px, 71 KB)

Screen Shot 2018-02-15 at 1.38.43 PM.png (530×410 px, 49 KB)

(3) Sometimes, the popup content is outside of the viewport.

Screen Shot 2018-02-15 at 1.37.58 PM.png (547×1 px, 131 KB)

Checked in cawiki (wmf.21) - the new message generally looks and works as expected.
Presently, the message, as it was pointed out, does not differentiate between the non-exisitng-in-the-list language entered and the case when the article does not exists in the language (##2-4 cases display the same message).

However, @Pginer-WMF - please review the following to confirm that the behavior is ok.

Thanks @Etonkovidova. The behaviour seems ok for the current iteration. We'll move it to the backlog for further improvements (custom messaging for each case and further polishing).

Pginer-WMF lowered the priority of this task from High to Medium.
Pginer-WMF added a subscriber: santhosh.

@Amire80 It seems that there is different behavior depending on whether lang links are present for an article or not (the popups are different).

(1) The case for https://en.wikipedia.org/wiki/Ivory_Coast (reported in T188860: 1.31.0-wmf.23, 2018-03-04: "No results found" is shown when searching for an unavailable language in compact language links) is fixed in wmf.24

Screen Shot 2018-03-09 at 9.47.28 AM.png (528×892 px, 93 KB)

(2) The articles that do not have lang links, e.g. https://en.wikipedia.org/wiki/List_of_Clerks_of_the_Legislative_Council_of_Hong_Kong, will display "No results found".

Screen Shot 2018-03-09 at 9.44.56 AM.png (399×966 px, 66 KB)

(2) is expected because the cog is not part of compact language links.