Page MenuHomePhabricator

Namespaces multiselect widget only displays namespaces that match the input value exactly
Closed, ResolvedPublic2 Estimated Story Points


From T214197: Typing in the namespace number does not show suggestions, but is accepted on return keystroke. This is not a major issue, but my expected behavior would be for the suggestions to show the matching options (e.g. typing 11 will suggest Template talk)

A related problem is that the option for (Main) does not display - and is NOT accepted on pressing enter - if the user types Main without the parentheses.

We need to override the getItemMatcher in the OO.ui.MenuSelectWidget. There is some discussion about ways to handle the case where a single method needs to be overridden in T215346 - until that is resolved, we can make a subclass of MenuSelectWidget that overrides this method.

Expected behavior

  • When a user types a number, the correlating namespace name should display in the drop-down suggestions.
  • When a user types the name of the main namespace without the parentheses, the main namespace option should display in the drop-down suggestions (should be tested in multiple languages)

Event Timeline

Tchanders triaged this task as Medium priority.Feb 13 2019, 9:17 PM
Tchanders created this task.

Change 488746 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[oojs/ui@master] SelectWidget: Allow 'getItemMatcher' to be replaced by custom functions

Change 493351 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] NamespaceMultiselectWidget: Allow filtering by namespace ID

Change 493351 merged by jenkins-bot:
[mediawiki/core@master] NamespaceMultiselectWidget: Allow filtering by namespace ID or label

We support substring matching of both the text and the number of the namespace. E.g. "4" will return namespaces 4 and 14.

To find the "(Main)" namespace (or "(Article)" as it is on beta) you don't need to include parens in your search (but can if you like).

As far as I could tell the correct namespaces were returned (although I did not have a complete list of the namespaces on beta, because I think there are some custom ones).

I checked that the correct namespaces were applied to the block after posting it (by checking Special:BlockList).

Retested UI interactions: clicking/tapping, arrow keys, enter, tab, removing namespace pills, dragging namespace pills around. Could see no problems.

Capitalisation of input does not seem to matter. However, underscores appear to. E.g. you have to write "User talk". "User_talk" will not find anything. (But, this is how it behaved before).

Attempting to input the same namespace more than once is ignored.

Tested this in both english and (briefly) german. Substring matches against the namespace translation of the respective language.

Environment: 1.33.0-alpha (2c13d34) 08:35, 12 March 2019
Local vm 1.33.0-alpha (2c13d34) 08:35, 12 March 2019

Tested platforms:
Firefox 60
Chromium 57
Android 6.0.1 stock browser

I tried IE8 but this appeared to revert to an interface much like with no-js.

Wonderful wonderful. The underscores are not a concern of mine.