Page MenuHomePhabricator

Add space between page namespace and page title
Open, Needs TriagePublic

Assigned To
None
Authored By
Esanders
Aug 22 2022, 3:21 PM
Referenced Files
F35489713: image.png
Aug 25 2022, 12:09 PM
F35489710: image.png
Aug 25 2022, 12:09 PM
F35489708: image.png
Aug 25 2022, 12:09 PM
F35489704: image.png
Aug 25 2022, 12:09 PM
F35489706: image.png
Aug 25 2022, 12:09 PM
F35484101: image.png
Aug 22 2022, 3:21 PM
F35484103: image.png
Aug 22 2022, 3:21 PM
Tokens
"Like" token, awarded by Jdforrester-WMF.

Description

The editing team is current working on this small visual change for talk pages in T313636. As a result MediaWiki core was updated to allow skins to style parts of the title separately (namespace/separator/title).

Example: https://en.wikipedia.beta.wmflabs.org/wiki/Talk:Polar%20bear?dtenable=1

beforeafter
image.png (121×249 px, 8 KB)
image.png (125×251 px, 8 KB)

We should consider up-streaming this change and applying it to all namespaces.

Note the open questions on T313636 around the possible localisation of this feature:

how will we enable wikis to vary the spacing around colons to match the conventions for their language (e.g. French puts spaces on either side of a colon [iii], Chinese uses a colon which has more space on either side of it as well [iv]).
[...]
iii. https://fr.wikipedia.org/wiki/Deux-points
iv. https://zh.wikipedia.org/wiki/%E5%86%92%E5%8F%B7#%E9%9B%BB%E8%85%A6

Event Timeline

Change 825418 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] [POC] Typographically correct language-specific namespace separator

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

Example on jawiki:
before

image.png (45×248 px, 3 KB)

after
image.png (62×291 px, 3 KB)

frwiki:
before

image.png (50×516 px, 8 KB)

after
image.png (41×528 px, 8 KB)

The only regression is the selection highlight doesn't include the space. This could be fixed with some JS (swapping out the content on a copy event):

image.png (54×529 px, 8 KB)

The only regression is the selection highlight doesn't include the space. This could be fixed with some JS (swapping out the content on a copy event):

image.png (54×529 px, 8 KB)

Another issue with the CSS approach is that it breaks triple-click to select the whole heading in Chrome (works fine in Firefox).

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/be55d10977/w

Change 901688 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/core@master] Alternative CSS approach to make triple click and highlighting work

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

Test wiki created on Patch demo by ESanders (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/a8aade8d69/w

Change 901688 abandoned by Esanders:

[mediawiki/core@master] Alternative CSS approach to make triple click and highlighting work

Reason:

squashed into parent

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

DISPLAYTITLE changes should be tested in any implementation of this.

DISPLAYTITLE changes should be tested in any implementation of this.

Per T306440:

The new markup is not added when the title is overridden using the wikitext {{DISPLAYTITLE:…}} or -{T|…}- forms. This may be improved in the future.

The parsing team can better speak to why these two cases are complex to support, but part of it is that is that DISPLAYTITLE allows HTML spanning the namespace and title.

I don't think this is a good idea. Titles are not normally typed with a space between the colon and the title, so I think displaying it with a space between the colon and the title could be confusing.

This also adds unnecessary complexity, both to code, and to the elegant system we currently have where what you see corresponds 1:1 with the proper title.

In fact, I'd recommend rolling back this change that is currently live in the talk namespace on mobile.

Related: T338151: Unexpected space between namespace and talk page title on pages in mobile subdomain

@Novem_Linguae Hypothetically, if the "proper" title was also changed to include a space (e.g. if the canonical URL was https://en.wikipedia.org/wiki/Talk:_Drew_Doughty, if mw.config.get('wgPageName') returned 'Talk:_Drew_Doughty', and so on), would you consider that a better approach?

Change the output of mw.config.get('wgPageName')? That's a massive change that would break all sorts of user scripts and gadgets. I would definitely not be in support of that.

Think of all the if ( mw.config.get('wgPageName') === myString ) type code that would need to be rewritten.

I don't think this is a good idea. Titles are not normally typed with a space between the colon and the title, so I think displaying it with a space between the colon and the title could be confusing.

This also adds unnecessary complexity, both to code, and to the elegant system we currently have where what you see corresponds 1:1 with the proper title.

I think with this kind of change, it is mostly a ‘deploy and then see if anyone objects on solid grounds’ approach. If the page title code is still Talk:Cat, there’s nothing that makes a stylistic change to how title gets displayed wrong. And, to be honest, I’ve always found the style we are currently having a bit too technical. It is true that the title should still match the URL, but it does in the proposed change. This is what matters. If that were to change (like, if some browsers copied CSS content), we would need to consider not doing this.

@Novem_Linguae Hypothetically, if the "proper" title was also changed to include a space (e.g. if the canonical URL was https://en.wikipedia.org/wiki/Talk:_Drew_Doughty, if mw.config.get('wgPageName') returned 'Talk:_Drew_Doughty', and so on), would you consider that a better approach?

This would significantly complicate i18n. frwiki would have to have Discussion_:_Drew_Doughty, jawiki ノート:メインページ and so on. If it could not be expected that all page names (except in mainspace) are prefixed with the namespace name + :, it would be such a disruptive change.

And if it only differed in the top heading, everybody would start imitating it elsewhere (because people hate inconsistencies), increasing the gap between internal and aesthetic names.