Page MenuHomePhabricator

Make alphabetical ordering of undocumented parameters case-insensitive
Closed, ResolvedPublic3 Estimated Story Points

Description

New undocumented parameter are automatically being ordered alphabetically, but case-sensitive. This can be confusing.

Screenshot from 2021-10-05 11-04-38.png (943×1 px, 88 KB)

Event Timeline

Andrew-WMDE set the point value for this task to 2.
Andrew-WMDE moved this task from Sprint Backlog to Doing on the WMDE-TechWish-Sprint-2021-09-29 board.
WMDE-Fisch changed the point value for this task from 2 to 3.Oct 7 2021, 8:59 AM

@Andrew-WMDE:

diff --git modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js
index ab57dec5c..20806e390 100644
--- modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js
+++ modules/ve-mw/dm/models/ve.dm.MWTemplateSpecModel.js
@@ -210,7 +210,7 @@ ve.dm.MWTemplateSpecModel.prototype.getCanonicalParameterOrder = function () {
 
                if ( aIsNaN && bIsNaN ) {
                        // Two strings
-                       return a < b ? -1 : a === b ? 0 : 1;
+                       return a.localeCompare( b );
                }
                if ( aIsNaN ) {
                        // A is a string

Change 727215 had a related patch set uploaded (by Andrew-WMDE; author: Andrew-WMDE):

[mediawiki/extensions/VisualEditor@master] Use .localeCompare() when sorting undocumented parameters

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

Change 727215 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Use .localeCompare() when sorting undocumented parameters

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