Page MenuHomePhabricator

In edit preview, always sort the template list in alphabetical order
Closed, ResolvedPublicBUG REPORT

Description

When editing an article in the English Wikipedia using the source editor, the templates used are listed below the edit textarea under:
Pages transcluded onto the current version of this page
The templates are in alphabetical order, followed by the modules in alphabetical order.

Afterwards, when previewing the edit, the templates are listed in a different order (probably in order of evaluation).

Instead, when listing the templates, always sort them into alphabetical order.

Event Timeline

I can reproduce, but only when using live preview (Preferences → Editing → Show previews without reloading the page).

I actually like the non-alphabetic sorting. When dealing with deeply nested templates, the order of evaluation helps finding through which template a nested template is transcluded.

Sort of, but no. Please sort them into a consistent order

I think we probably all agree that they should be in the same order regardless of whether they're loaded server-side or client-side.

It looks like the PHP sorting has been in place since 2008, and (at least on Wikimedia sites) live preview is not nearly as widely used as non-live preview (rough numbers from two days ago: 150k nonlive, 7k live, 25k realtime), I'd suggest that most people are seeing the list sorted, and therefore we should fix the client-side display to be sorted.

Maybe action=parse should be returning the template names already sorted?

If I just want to review which templates I am using, I want alphabetical order, but if I want to confirm I am using templates in a consistent order across pages (and am not using a template to enforce this), I want to see them listed in the order I use them in.