Page MenuHomePhabricator

When typing a namespace, the top option should be highlighted and be able to be added with enter
Closed, ResolvedPublic

Description

As a user
I want to be able to choose the current top option from the namespace search
so that I can use the keyboard to choose namespaces more quickly

Ideal Solution

  • The namespaces dropdown highlights the current top option in blue. If a user presses enter, that namespace is added. It should behave like the tags selector on phabricator.

Acceptance Criteria

  • Investigate if the solution can be done as part of OOUI. If it cannot, please report, so we can see if it should be included into OOUI in general

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 21 2017, 4:13 PM
Lea_WMDE moved this task from Proposed to Todo on the WMDE-QWERTY-Team board.
Lea_WMDE triaged this task as Medium priority.Dec 14 2017, 11:31 AM
Lea_WMDE updated the task description. (Show Details)

Should probably be done in OOjs UI @Volker_E

Ah! We actually did that in RCFilters, with a hack, see here: https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js#L264

The idea is that we go over the visible items after they're toggled visible/invisible (in updateItemVisibility) and then we select the first available item. We do that only if we're not in "select" mode, in case the user clicked one of the bubble/tags that already exists. In that part, we select the menu item from the list and scroll to it.

Head's up about this code -- it is about to be replaced SLIGHTLY, because RCFilters uses different "views" (there are 3 possible lists of items that can appear in the menu) and we have to keep track of what appears and what doesn't, so we canceled the filtering that is internal to the MenuSelectWidget, and will instead be using our own model.
(You can see that fix here: https://gerrit.wikimedia.org/r/#/c/397996/ but I don't think it's really affecting what you're doing, since your menu always has a single non-changing list)

Did this help? We might want to upstream this behavior if this is overall helpful/wanted.

Hi @Mooeypoo, we can't think of any reasons why this should not be standard behavior, so we would be really happy if it was part of OOUI :) Is this easy for you to do or should we give it a try?

matmarex closed this task as Resolved.Mar 1 2018, 7:38 PM
matmarex added a subscriber: matmarex.

Looks like the OOUI patch in T187398 fixes this. It will probably be released next Tuesday, then we'll upgrade the OOUI version in MediaWiki, which will then reach WMF production wikis on the Tuesday-Thursday of the week after that.

Jdforrester-WMF moved this task from Backlog to OOUI-0.25.3 on the OOUI board.Mar 1 2018, 7:54 PM
Jdforrester-WMF edited projects, added OOUI (OOUI-0.25.3); removed OOUI.
Volker_E assigned this task to Mooeypoo.Mar 20 2018, 1:32 AM

Heyho, we have just found weird behavior that to me looks like it would originate from this change: T190156: first item in namespace drop-down isn't always preselected . Could you take a look at it? Thanks :) @Mooeypoo @matmarex