Community Wishlist Survey 2022/Categories/Limit which namespaces are allowed in a category on the category page itself

Limit which namespaces are allowed in a category on the category page itself

  • Problem: In order to avoid unwanted pages from polluting categories intended for other namespaces, we waste our time and effort manually removing or commenting out [[Category:...]] and coding templates so that they add categories only in certain namespaces.
  • Proposed solution: A magic word or extension tag to be used inside category wikitext that determines which namespaces are allowed (or not allowed) in the category.
  • Who would benefit: Readers and editors
  • More comments:
  • Phabricator tickets:
  • Proposer: Nardog (talk) 08:02, 21 January 2022 (UTC)[reply]

Discussion

  • One application of this would be disabling article categories in the draft namespace (relevant wish). {{u|Sdkb}}talk 22:44, 23 January 2022 (UTC)[reply]
  • @Nardog: Is your use case solely about categories in English Wikipedia's draftspace (and userspace drafts, I guess), and if so, are you okay with us archiving this in favor of Prevent draftspace pages from being placed in article categories? I would select that one because the focus is more clear to voters. If there is a need for this functionality beyond English Wikipedia drafts, this proposal can of course stay, however I'm a little concerned about the request to filter by namespace when browsing a category. In most cases this will be just fine, but for very large categories it could cause performance problems (maybe), so I think the focus of this proposal should be aboutstorage of categories, not the display of it's members. So instead of filtering by namespace when viewing a category, we make sure it's never categorized there in the first place (based on the namespace). Does that makes sense? Please let us know how'd you like to proceed. Thanks! MusikAnimal (WMF) (talk) 02:19, 25 January 2022 (UTC)[reply]
    @MusikAnimal (WMF): No, focusing on articles vs drafts is far too specific IMO. If anything this wish should subsume that one, not the other way around. Reliable filtering would likely involve changes to how categories are stored in the first place, indeed, and if that's too long a shot then I wouldn't mind changing this to one about preventing certain namespaces from creeping in category by category (which I really think should be possible via a magic word or extension tag to be used in category wikitext), which would make this and Sdkb's meet in the middle. Nardog (talk) 07:51, 25 January 2022 (UTC)[reply]
    Okay, thanks for clarifying. Again it's just the A multiselect interface like Special:Search on each category page that filters which namespaces to show that worries me (ideally we'd remove that proposed solution to not mislead voters), but we focus on the problem, not the solution anyway. The draftspace proposal is more focused and hence could have a different, more focused solution, but I'm thinking we'll just let both proposals go to voting and if we pick one up one we'll effectively work on both. Thanks, MusikAnimal (WMF) (talk) 19:11, 25 January 2022 (UTC)[reply]
    I was bold and went ahead and removed the "multiselect interface…" bit. Let me know if that's a problem! When we first read this proposal, we were thinking it could be external tool (since that is allowed to have slower queries), but that wouldn't solve the use case of drafts being categorized. MusikAnimal (WMF) (talk) 19:14, 25 January 2022 (UTC)[reply]
    @MusikAnimal (WMF): Then can you move this to "Preemptively exclude certain namespaces from a category on the category page itself" or something? My main idea was the post-hoc filtering, which you've abandoned, so the title doesn't fit anymore.
    Focusing on drafts strikes me as a bad idea. Some categories are meant to include articles and drafts, but not talk pages, and so on. Jettisoning flexibility when the same principle can have wider applicability makes little sense to me. Nardog (talk) 05:19, 26 January 2022 (UTC)[reply]
    @Nardog Good call! How about "Ignore categories from being saved when placed in certain namespaces"? If it wasn't clear, we're trying to avoid any kind of "filtering" by namespace when viewing categories. Instead, we will use a parser function / magic words to distinguish where they are allowed to be saved. So en:Category:Living People for instance would have something like (a crude markup) {{#catnamespace:0}} so it only gets stored on the main namespace. We'd find more ways to do this en-masse, or have inverse functions like {{#catnonamespace:0}} (Living People shown everywhere but the mainspace). Going the route of storage, we don't have to worry about query times when browsing categories since we won't need namespace filters. Does that sound right? This removes any focus on Drafts, specifically (I just used it as an example). It could be used for any purpose. MusikAnimal (WMF) (talk) 05:55, 26 January 2022 (UTC)[reply]
    @MusikAnimal (WMF): "Ignore categories from being saved when placed in certain namespaces" doesn't quite capture what this is about IMO. The crux of the proposal is that it's done on a category-by-category basis, on the category page itself (as opposed to where [[Category:...]] is placed). I fail to see what you thought was lacking in my suggestion ("Preemptively..."). (ETA: How about "Limit which namespaces are allowed in a category on the category page itself"?) Nardog (talk) 06:41, 26 January 2022 (UTC)[reply]
    We're on the same page, I think (putting the markup on the category page itself), just struggling with a clear title. "Limit which namespaces are allowed in a category on the category page itself" sounds fine, I've moved the it there :) Thanks, MusikAnimal (WMF) (talk) 15:44, 26 January 2022 (UTC)[reply]
    @MusikAnimal (WMF): Thanks, but now the solution needs updating. "which namespaces to be shown by default" should be "which namespaces can be included in the category" or something. Nardog (talk) 06:06, 27 January 2022 (UTC)[reply]
  • Just to clarify, this would automatically also apply to all subcategories, right? Jochem van Hees (talk) 17:28, 31 January 2022 (UTC)[reply]

Voting