Page MenuHomePhabricator

Firefox sorts API template (and other?) suggestions in a very poor manner, unlike Chrome/Safari/Opera
Closed, ResolvedPublic1 Estimated Story Points

Description

In VE, Insert->Template. Type "cn".

Expected behavior: The "cn" template is sorted at the top of the list.

Actual behavior: The "cn" template is sorted towards the middle of the list, with "cnblue" at the top for no discernable reason.

The behavior when hitting enter is related, and worse: if I type "cn<enter>", and there is an exact match on cn, then I definitely expect to get cn as the output not "cnblue".

Event Timeline

LuisVilla raised the priority of this task from to Needs Triage.
LuisVilla updated the task description. (Show Details)
LuisVilla added a project: VisualEditor.
LuisVilla added a subscriber: LuisVilla.

This is the order from the Search system being wonky…

Working just fine for me. Better than fine, in fact; it resolves the redirect and shows me the *actual* template I was trying to get, rather than inserting a transclusion of a redirect.

Screen Shot 2015-09-08 at 16.18.13.png (1×1 px, 208 KB)

Deskana claimed this task.

Resolving as invalid since I'm unable to reproduce. @LuisVilla, if you're still experiencing this issue, please provide more detailed steps to reproduce the issue so I can investigate and reopen if necessary. Thanks!

LuisVilla reopened this task as Open.EditedSep 9 2015, 3:59 AM

Attached is what I see; enwiki, Firefox, Linux. I believe I also see the same on Firefox Mac but don't have that box handy right now. Might be platform/browser specific, but reopening in any case. Dan, agree that the behavior you're seeing is great/desired behavior.

Screenshot from 2015-09-08 20-55-43.png (566×516 px, 21 KB)

Attached is what I see; enwiki, Firefox, Linux.

Confirmed. I cannot reproduce the problem in Chrome, but I can in Firefox.

The queries that are issued by VisualEditor in both browsers are identical, and in both the CNBLUE result's index is 10, which means it really shouldn't be appearing at the top. This appears to be a bug specific to VisualEditor in Firefox.

Jdforrester-WMF renamed this task from autocomplete of templates selects unexpected template to Firefox sorts API template (and other?) suggestions in a very poor manner, unlike Chrome/Safari/Opera.Sep 9 2015, 9:24 PM
Jdforrester-WMF reassigned this task from Deskana to Krenair.

Change 237410 had a related patch set uploaded (by Alex Monk):
Order template title results by provided index

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

I think we were relying on undefined behaviour to sort those (response.query.pages was showing in different orders depending on which browser you used), instead my code tries to put them all into a list keyed by the given indexes.

Change 237410 merged by jenkins-bot:
Order template title results by provided index

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