Page MenuHomePhabricator

Give immediate feedback whether subpages exist
Closed, DeclinedPublic3 Estimated Story Points

Description

As a user,
I want to have some feedback when searching in subpages,
so that I can get more precise search hits and avoid empty searches.

Problem to avoid: If I put a page in the subpages field, and this page (unbeknown to be) has no subpages, I get no results and don't know why.

Acceptance Criteria:

  • When there is text in the subpage search field and no pages are found with the search term (suffixed with '/'), a message is shown.
  • There is a 100-200ms delay before the message is shown, to allow for more user input ("debounce".)

Background:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
gabriel-wmde renamed this task from Improve subpage field to Improve subpage search field .Jul 11 2017, 2:55 PM

@Charlie_WMDE @Jan_Dittrich Please specify further how the feedback should look. I can do a background search for how many pages are found when looking for "content of search field" + '/'. That should either be 0 (no subpages) or a positive value.

@Charlie_WMDE @Jan_Dittrich Please specify further how the feedback should look. I can do a background search for how many pages are found when looking for "content of search field" + '/'. That should either be 0 (no subpages) or a positive value.

That sounds like a good idea to me. It would be helpful to display it right away and not only after the search was triggered. Is that possible?

gabriel-wmde set the point value for this task to 3.

@Charlie_WMDE Yes, that is meant with "background search". For the first iteration we'd display a red text beneath the field when no pages are found.

According to the Ajax doc (https://www.mediawiki.org/wiki/Manual:Ajax), we can use

mw.loader.using( 'mediawiki.api', function () {
	( new mw.Api() ).get( {
		action: 'query',
		list: 'search',
		srsearch: 'prefix:test/'
	} ).done( function ( data ) {
		console.log( data );
	} );
} );

Hey @gabriel-wmde

I would imagine it to look smth like this:

Screenshot_20170718_161522.png (162×1 px, 16 KB)

Depending on the length of the text, the other fields would need to move down and make space for additional lines of text.

If it's not possible to have the content of the field be part of the message and thus making the fields move around, then I would just leave it out and write "No subpages were found for this page."

@Pablo-WMDE

  • Add selected namespaces to API query
  • publish to gerrit

Any code to link here yet?

I'm actually not finding the codebase. Putting advanced search or Pablo into the search box on Gerrit is not returning what I want :)

@gabriel-wmde rigthfully mentioned we should also pass the currently selected namespaces to the query fetching the prefix-pages.

-> https://en.wikipedia.org/w/api.php?action=help&modules=query%2Bsearch

Prefix search seemingly does not obey namespace limitations. That is a "feature": https://www.mediawiki.org/wiki/Help:CirrusSearch#Prefix_and_namespace

Example (The Big Bang Theory should probably not appear in Help pages)
https://en.wikipedia.org/w/index.php?search=prefix%3Athe&title=Special:Search&profile=advanced&fulltext=1&ns12=1

curl "https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=prefix%3Athe&srnamespace=12"

@Lea_WMDE @Charlie_WMDE @Jan_Dittrich
Implementing this feature we encountered a challenge that can not easily be mitigated and probably requires a change in either the future of this story or the way we communicate with the user.
CirrusSearch, the underlying search extension, can not search for articles with a given title prefix in multiple namespaces.
This influences both, our ability to provide feedback to the user, and the significance of the search result even if the user submitted the query.
https://www.mediawiki.org/wiki/Help:CirrusSearch#Prefix_and_namespace (the German translation to me felt more to the point)

There are two cases for which we can realize the AC

  • if there is exactly one namespace selected
  • if there are all namespaces selected (via the _all:_ prefix)

In all other cases we can not (technically) do the preview, and should show an error message that the search will yield undesired results.

This also, again, raises the question that @gabriel-wmde already mentioned in T170278 - what happens if the user specifies a prefix namespace that differs from the selected check-box namespace?

Please advise.

Pablo-WMDE changed the task status from Open to Stalled.Jul 24 2017, 1:18 PM
Pablo-WMDE removed Pablo-WMDE as the assignee of this task.
Pablo-WMDE moved this task from Doing to Todo on the WMDE-Fundraising-Sprint-7 board.
Pablo-WMDE moved this task from Todo to Done on the WMDE-Fundraising-Sprint-7 board.
Pablo-WMDE moved this task from Done to Review on the WMDE-Fundraising-Sprint-7 board.

CirrusSearch, the underlying search extension, can not search for articles with a given title prefix in multiple namespaces.

Just to clarify: is this only true if we look for the prefix in the titel? Like in your example with prefix:the ?
This is not a use case of ours since we'll be adding the / to the search terms and are framing it as a subpage search.

The question is, if I'm looking for prefix:wikipedia/ with Article as my selected namespace, will it also break?

If so, I suggest we kill all namespaces selected in the namespace area if the prefix: parameter is used. Disabling would be the best so the user doesn't have to add them all back when removing the prefix: parameter again.

This also, again, raises the question that @gabriel-wmde already mentioned in T170278 - what happens if the user specifies a prefix namespace that differs from the selected check-box namespace?

answered on the ticket.

@Charlie_WMDE The search won't "break" as such, it's just that the namespace selection is completely ignored when using the prefix: keyword, regardless of namespace selection. Unselecting the namespaces could be outside the view, so it's not sure the user sees this. And what if he scrolls down after entering terms in the subpage search and selected namespaces? should the namespace bar be disabled then? And if yes, how do we indicate to the user why it's disabled?

Hey @gabriel-wmde these are all super valid questions. Thanks for pointing them out.

Unselecting the namespaces could be outside the view, so it's not sure the user sees this. And what if he scrolls down after entering terms in the subpage search and selected namespaces? should the namespace bar be disabled then?

The namespace bar should indeed be disabled when there's a namespace entered in the prefix: field looking like this

Screenshot_20170725_143948.png (67×666 px, 5 KB)

And if yes, how do we indicate to the user why it's disabled?

Indicating this will be necessary at both locations. Once next to the prefix field, explaining that entering a namespace here will disable the other namespaces and once with the other namespaces, explaning that it's disabled because of the prefix field.

I will make a mock for it and post it here later today.

On top we'd just have a warning message displayed which is always there, regardless of the field being filled or not.

In the namespace section we had to think of a different solution because the text couldn't be inside the form but also couldn't be outside because then it wouldn't seem like it belong anywhere anymore. Jan's idea was to have a little footer that flies out which includes the information and disappears again, when there's nothing to display. @gabriel-wmde @Pablo-WMDE is this smth that is possible to make since it's not part of the standard OOUI kit?

Screenshot_20170725_165358.png (348×499 px, 25 KB)

Here's just how it would look when the "no subpages found" warning is there at the same time.

Screenshot_20170725_165538.png (514×714 px, 43 KB)

Thanks for the mocks @Charlie_WMDE! one thing that I am still missing is letting the user know which namespace they are currently searching in. Is it all? Only article? The specified one via <namespace>:sth ?

Just realised the screenshots are tiny. Sorry for that :/

Thanks for the mocks @Charlie_WMDE! one thing that I am still missing is letting the user know which namespace they are currently searching in. Is it all? Only article? The specified one via <namespace>:sth ?

I'm not sure this is super relevant but I can see how that might not be super clear from the help text as it currently is.

I would suggest to change the text to "The namespace selector is disabled because it's being overwritten by an entry in Subpage of this page:"

Does that make it clearer what namespaces are being looked for? @Lea_WMDE

If "all" is selected, these messages should of course not e displayed.

After discussing this today, we decided to not have the prefix: parameter in our MVP. I still want to write down the new understanding I've gotten from it today:

If a namespace in this format namespace:subpage is entered into the field, it will overwrite all other selected namespaces and search only in the one entered in that field unless ALL namespaces have been selected.

If just a random word (which is not a namespace) is entered into the field, the search automatically assumes that the namespace is article. So entering elephant would lead to it searching in article:elephant.

If a namespace in this format namespace:subpage is entered into the field, it will overwrite all other selected namespaces and search only in the one entered in that field unless ALL namespaces have been selected.

Not 100% correct: The namespace selection is always ignored, but to search for a subpage through all namespaces, you can use the special all namespace in the prefix search, e.g. prefix:all:elephant

@Pablo-WMDE I've re-opened the task because I'd still like to keep track of it on the advanced search board since we haven't definitely decided to kick it out but just no not have it in our MVP.

Lea_WMDE renamed this task from Improve subpage search field to Give immediate feedback whether subpages exist .Feb 15 2018, 4:24 PM
Lea_WMDE closed this task as Declined.
Lea_WMDE triaged this task as Low priority.
Lea_WMDE updated the task description. (Show Details)

Let's wait if this is really an issue people struggle with. If we realize this ticket, we should keep in mind that there is a close connection to the currently selected namespaces and we would have to find a way to make people aware of their namespace selection as well.