Page MenuHomePhabricator

Create a Special:NamespaceInfo page
Closed, ResolvedPublic

Description

Look, there are a lot of namespaces across many more wikis. It's hard to keep track of them all and their various properties, so I just want to see something like Special:ListGroupRights for namespaces.

I'm looking for a table that would be (using Scots Wikipedia as an example):

IndexNamespaceProperties
0Main$hooks
1TalkAssociated talk page for Main
2User$hooks
3User talkAssociated talk page for User
4Wikipedia$hooks
5Wikipedia talkAssociated talk page for Wikipedia
6File$hooks
7File talkAssociated talk page for File
8MediaWiki$hooks
9MediaWiki talkAssociated talk page for MediaWiki
10Template$hooks
11Template talkAssociated talk page for Template
12Help$hooks
13Help talkAssociated talk page for Help
14Category$hooks
15Category talkAssociated talk page for Category
100Portal$hooks
101Portal talkAssociated talk page for Portal
102Define$hooks
103Define talkAssociated talk page for Define
828Module$hooks
829Module talkAssociated talk page for Module
2300Gadget$hooks
2301Gadget talkAssociated talk page for Gadget
2302Gadget definition$hooks
2303Gadget definition talkAssociated talk page for Gadget definition
IndexNamespaceProperties
-1Special???
-2MediaFiles/Images.

Related/Other open tasks

Event Timeline

What are $hooks?

I suspect if we're going to do something like this, it should list aliases too

It's all public information, and is available through the API - https://sco.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases

Might be worth including other information that API module includes too... Namespace protections, content models, subpages etc. Basically anything that someone might want to know, but it shouldn't require a human to poke the API, or look at the wiki config to find out

Shouldn't be too difficult to implement though!

@Reedy if I send a patch, would you be willing to review?

@Reedy if I send a patch, would you be willing to review?

Yeah. I think it's something reasonably valuable to have

DannyS712 triaged this task as Low priority.

Might be worth thinking about maybe adding a "description" message for the namespace and it's user talk too

Especially if they're implemented by extensions and such, being able to link to docs on what they do etc

And then for site specific stuff, we can add messages to WikimediaMessages

(Yes, scope creep)

I'm thinking something like

idCanonical nameLocal nameDescriptionProperties
0(main)(main)Main namespace
1TalkTalkTalk pages for the main namespace
8MediaWikiMediaWikiNamespace controlling the display interfaceNamespace protection: editinterface
2302Gadget definitionGadget definitionDefinitions of site gadgetsDefault content model: GadgetDefinition

(for English, Canonical=Local so maybe don't include the canonical column?)
We can also include under properties if there are subpages enabled, if it is a content namespace, and if it is nonincludable

Messages for the descriptions should be added by extensions that add the namespaces, falling back to the default of something like "Custom namespace from an installed extension"

Love it.

@DannyS712 Maybe for 0 it could make use of the message from MediaWiki:Blanknamespace, since that's what folks will locally see most often. I can imagine '' would be useful for the literal sense.

I made this task on a whim without any expectation that people would actually review it. I can't believe there's a chance it might get implemented! [0_0]

I'm so excited now!! <3

I must admit, this is one of these "Why haven't we done this already?" ;)

Change 637656 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add Special:NamespaceInfo

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

I'm sorry that I haven't handled this task. I recently returned from a long bout of unexpected inactivity, and while I plan to resume my contributions here on Phabricator its unfair to claim tasks that I might not work on when others may be interested in handling them. I'm removing myself as the assignee in a batch-action, but if someone feels that I really should be the one to handle this task feel free to re-assign me and I'll take a look.

I just encountered Template:Namespaces on https://en.wikipedia.org/wiki/Wikipedia:Administration#Data_structure_and_development (and other pages), and I immediately thought it should exist as a Special: page on all wikis. In the past, I've struggled with figuring out the actual namespaces and their IDs for mediawiki.org and wikitech.wikimedia.org (especially because on the latter there are some pages with titles that masquerade as namespaces, like Portal:). Having an easily accessible list of namespaces like this would make it easier to understand and manage content on our technical wikis...without having to "poke the API or look at the wiki config". Also, even if you do poke the API or look at the config, the template's table format is just so much lovelier and easier to quickly understand.

Test wiki created on Patch demo by 沈澄心 using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/5f89f222b0/w

matmarex renamed this task from Create a Special:Namespaces page to Create a Special:NamespaceInfo page.Aug 22 2024, 2:47 AM

Change #637656 merged by jenkins-bot:

[mediawiki/core@master] Add Special:NamespaceInfo

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

matmarex assigned this task to DannyS712.
matmarex subscribed.

The new special page will describe namespaces added by extensions as just "Custom namespace <name>", until a localisation message like "namespaceinfo-description-ns<id>" is defined for each namespace. I filed T373070 about doing that (patches welcome).

For Tech News,

  • Content-wise: Which aspects/use-cases can we highlight in the prose description? Is there anything else we can helpfully link people to, aside from the Special page itself? (Is there/should there be a docs page?)
  • Timing-wise: I propose waiting another week, so that: We can word it in the present-tense; the link won't be a redlink for a few days; and some more translations are likely to be ready by then.
  • Draft wording (edits appreciated!):

There is a new easily accessible list of the namespaces on each wiki at [[Special:NamespaceInfo]]. This page may help you to [...?...]. Thanks to DannyS712 for these improvements. [ 1 ]

I'm thinking something like

idCanonical nameLocal nameDescriptionProperties
0(main)(main)Main namespace
1TalkTalkTalk pages for the main namespace
8MediaWikiMediaWikiNamespace controlling the display interfaceNamespace protection: editinterface
2302Gadget definitionGadget definitionDefinitions of site gadgetsDefault content model: GadgetDefinition

I like this better than the final version, in which descriptions and properties are dumped in the same column: the one column makes it much harder to scan through the descriptions or the properties. I didn’t find any discussion on this matter either in this task or on Gerrit. Is there any particular reason for merging the columns? Could this decision be reconsidered? (Maybe there could be even a separate column for the most common property – whether subpages are allowed/recognized.)


Another thing I noticed is that the table is not sortable. Sorting would make a lot of sense: one could sort by the namespace ID (to get the same sorting as everywhere else), by namespace name (English or localized, to quickly find a namespace by its name), or by properties (to at least partially group namespaces with similar properties together – although properties listed in the second or later places mess this up a bit).

@Tacsipacsi I haven't paid attention to that before, but now I tried mocking up the alternative table layout, and it results in a lot of line wrapping (given new Vector's narrow content column).

Screenshot 2024-08-24 at 20-38-59 Namespace information - Wikipedia the free encyclopedia.png (4×3 px, 1 MB)
Screenshot 2024-08-24 at 20-39-03 Namespace information - Wikipedia the free encyclopedia.png (4×3 px, 1 MB)

I'd say they both have pros and cons. I'd be happy with either of them, but I don't really see a reason to change it.


I also tried adding sorting (it just requires adding sortable to the table) and I'm not sure how I feel about it. It feels weird to see the list of namespaces in any other order than the "correct" one. And I think your use cases are better served by doing a find in your browser.

Screenshot 2024-08-24 at 20-47-25 Namespace information - Wikipedia the free encyclopedia.png (4×3 px, 1 MB)

@Tacsipacsi I haven't paid attention to that before, but now I tried mocking up the alternative table layout, and it results in a lot of line wrapping (given new Vector's narrow content column).

Thanks for the screenshots! Looking at them, I still find the five-column version easier to scan, despite the line breaks. In fact, the five-column layout results has less line breaks: in the four-column layout, almost every cell in the last column has a line break – between the description and the properties. (However, with the width constraints, I give up my idea on the sixth – subpages – column.)


It feels weird to see the list of namespaces in any other order than the "correct" one.

It’s probably because you’re too accustomed to the “correct” order. 🙂 I don’t think it would be that weird for a newcomer.

And I think your use cases are better served by doing a find in your browser.

If you don’t need the sorting, you don’t have to use it. It doesn’t do any harm if you never sort it (unlike the extra column, which could indeed get in one’s way – although I still think its pros outweigh its cons).

For Tech News, please could someone respond to my questions above at T263513#10085981. Thanks!

  • Content-wise: Which aspects/use-cases can we highlight in the prose description? Is there anything else we can helpfully link people to, aside from the Special page itself? (Is there/should there be a docs page?)

The special page helps understanding the actually existing namespaces on a given wiki. There’s https://www.mediawiki.org/wiki/Help:Namespaces (which I suggest as a help page for the special page and the Tech News entry – while it currently doesn’t mention the special page, it would be a straightforward place for doing so), but that only discusses core namespaces, not those that are added by extensions (e.g. Module) or set in site configuration (core-Namespaces.php on WMF wikis, LocalSettings.php on third-party ones; e.g. Portal).

For Tech News, I'll postpone this one more week, in case someone writes some documentation that we can link to (and in case any of the suggested tweaks above are implemented before the announcement).
Here's some proposed final wording for the entry (unless anyone suggests improvements):

Editors who want to understand which namespaces exist on each wiki, and some details about how they are configured, can use the new automated [[Special:NamespaceInfo]] page. Thanks to DannyS712 for these improvements. [ 1 ]

Great to see this merged! It will be helpful to me. I wanted to mention the same point as @Tacsipacsi: the namespaces appear to be in a random order (as seen here: https://translatewiki.net/wiki/Special:NamespaceInfo). Adding an option to sort by namespace ID would be useful for identifying which ID can be used for new per-wiki namespaces.

I wanted to mention the same point as @Tacsipacsi: the namespaces appear to be in a random order (as seen here: https://translatewiki.net/wiki/Special:NamespaceInfo).

I think that's caused by your 'LanguageGetNamespaces' hook here: https://gerrit.wikimedia.org/g/translatewiki/ /48548620a3b170aa6839814325e4ffee520b3baf/mw-config/TranslatewikiSettings.php#295

MediaWiki normally ensures that namespaces are in the numeric order, here: https://gerrit.wikimedia.org/g/mediawiki/core/ /a1dc207daac9314e81e894922e30dc430c66b91d/includes/language/Language.php#443. I'm not sure if it should call ksort() again after running the hook, or if it should be the hook's responsibility to do it. Either way, that will probably also fix the order of namespaces on other pages on TranslateWiki; for example https://translatewiki.net/wiki/Special:Search also shows them in the same "random" order now.

Oh thanks for digging that out. As far as I remember we did that specifically to make the order of namespaces better in Special:Search given the default order isn't great for that context.

I just learned about the new special page via TechNews and want to say that I love it!

I'm not sure if this is the best place, but here are some ideas for additional information we could show on the special page.

  • Number of pages per namespace. Especially highlight namespaces that are empty.
  • Is there something to say if and how a namespace is searchable?
  • List the shortcuts that can be used to link to each namespace.
  • Make sure the special page can list all localized aliases, not only the first one.
  • Mention the default content model and default content language for each namespace. At least for the namespaces where the content model is not the wikitext, and/or where the language is not the same as the wiki's default language.
  • If possible, mention the extension which is responsible for a namespace.
  • List the shortcuts that can be used to link to each namespace.
  • Make sure the special page can list all localized aliases, not only the first one.

Note that these two are one and the same: shortcuts are just aliases that happen to be shorter/easier to type than the primary namespace name. What counts as a shortcut is a human thing (e.g., on huwiki, I consider User vita: to be a shortcut for Szerkesztővita:, since it’s shorter and easier to type on an international keyboard, but historically it’s the former primary name, i.e. an alias). So it makes sense to list these, but together.

  • Mention the […] default content language for each namespace. At least for the namespaces […] where the language is not the same as the wiki's default language.

Does such a concept exist? As far as I’m aware, determining the page language is the responsibility of the content model (handler), not something namespace-specific. And the content model handlers deliver us a language if they’re given a title – so while some always (code like JavaScript or JSON – English) or by default (wikitext – wiki content language) return a specific language, this may not always be the case.

It will be great to get a note about this new special page in the release notes for 1.43

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

[mediawiki/core@master] Add release notes for Special:NamespaceInfo

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

Change #1094059 merged by jenkins-bot:

[mediawiki/core@master] Add release notes for Special:NamespaceInfo

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

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

[mediawiki/core@REL1_43] Add release notes for Special:NamespaceInfo

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

Change #1094078 merged by jenkins-bot:

[mediawiki/core@REL1_43] Add release notes for Special:NamespaceInfo

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