Module talk:WikiProject banner

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Template talk:WPBannerMeta)
WikiProject iconCouncil
WikiProject iconThis module relates to the WikiProject Council, a collaborative effort regarding WikiProjects in general. If you would like to participate, please visit the project discussion page.

Alternative way of triggering task forces[edit]

Some projects, including US Roads discussed above, have a different way of triggering task forces, where the value of a parameter defines the task force rather than the name of the parameter. For example |AL=yes uses the name of the parameter "AL" to define the task force; this is the way that most banners work. US Roads uses |state1=AL or |state2=AL, etc. and the value of the parameter "AL" defines the task force. This is currently really hard to code using this module, so I am thinking about other possibilities.

For example we could use |TF_PARAMETER_PREFIX=state with |tf 1=AL (or maybe a different parameter like |tf 1 value=AL would be more sensible). Then the module could check all parameters of the form |state1=, |state2=, |state3=, etc. and if any of those have value "AL" then the task force is triggered.

I'm just brainstorming at the moment, so any ideas would be good — Martin (MSGJ · talk) 10:08, 31 January 2024 (UTC)[reply]

In that specific template, is there anything that is blocking converting |staten= uses (|state20=AL) to just use |AL=yes? Gonnym (talk) 15:32, 31 January 2024 (UTC)[reply]
Do you mean a bot run to change these over? Yes, that could be possible alternative if the project was okay with that. — Martin (MSGJ · talk) 15:54, 31 January 2024 (UTC)[reply]
Yes. It seems much more trouble adding and supporting code that only one project uses instead of fixing that project's code to use the same style that every other project does. Gonnym (talk) 18:18, 31 January 2024 (UTC)[reply]
I've made the suggestion at Template talk:WikiProject U.S. Roads — Martin (MSGJ · talk) 18:31, 31 January 2024 (UTC)[reply]
An unpromising response over there. I feel it wouldn't be difficult to add this functionality to the module, without adding any overhead to existing uses. It could also be useful in other banners, e.g. Canada Roads — Martin (MSGJ · talk) 19:00, 2 February 2024 (UTC)[reply]

More page types[edit]

Now Module:Pagetype has the ability to detect two more types of page: soft redirects and set index articles. I proposed to make use of this by:

  • Automatically assessing soft redirects as Redirect-class, in any namespace;
  • Automatically assessing set index articles as List-class in article space, if no valid class is defined. (There are sometimes SIAs which are mischaracterised, so it would be useful to be able to override the default.)

Thoughts? — Martin (MSGJ · talk) 18:59, 2 February 2024 (UTC)[reply]

Code for this is now on Module:WikiProject banner/sandbox and Module:Banner shell/sandbox. Requested by @PARAKANYAA and @Hawkeye7. Have also taken the time to merge in the code from Module:Class mask. Needs a lot more testing though ... — Martin (MSGJ · talk) 20:11, 25 February 2024 (UTC)[reply]
Switching to use the sandbox version moved the article from Category:Unassessed articles to Category:NA-Class articles but I think it should be in Category:Redirect-Class articles. Hawkeye7 (discuss) 20:43, 25 February 2024 (UTC)[reply]
Please tell me which page you are testing on? Redirect-class will generally be used if the project has created the corresponding category, otherwise it falls back to NA-class — Martin (MSGJ · talk) 20:45, 25 February 2024 (UTC)[reply]
The page in question is -izzle. I have left it using the sandbox version so you can see it. Originally it had the banner shell but was not tagged for a project; I don't know how many of these are out there. As noted, Sandbox version switched it from Category:Unassessed articles to Category:NA-Class articles. Then, in response to your comment, I added a project template, {{WikiProject English Language}}. This is a standard template that uses Module:WikiProject banner. This caused a switch. It is now listed as Category:Unassessed English Language articles despite the fact that the {{WikiProject banner shell/sandbox}} template has a Class=Redirect card. No error is reported. I think it should have gone into Category:NA-Class English Language articles although it would be better still to create the Redirect category. Hawkeye7 (discuss) 21:03, 26 February 2024 (UTC)[reply]
It's because {{WikiProject English Language}} is using the live code and not the sandbox code that I have changed. If you have a look now, I have added the sandbox version and it is using Category:NA-Class English Language articles. (If Category:Redirect-Class English Language articles existed then it would use that, but it doesn't so falls back to NA-Class.) Hope this all makes sense — Martin (MSGJ · talk) 22:14, 26 February 2024 (UTC)[reply]
Most tests are working well (see Module talk:WikiProject banner/testcases). There is one apparent issue. I proposed above that set index articles could be manually assessed but will default to List-class. This is indeed possible, but this manual assessment would not be inherited by banners inside the banner shell (inheriting only happens if the article is otherwise unassessed by the banner, but in this situation it will not be unassessed because it will default to list-class). So I think the only two options are:
  • Automatic assessment of SIAs as list-class: no ability to override manually
  • No auto-assessment of SIAs: each one will need to be assessed individually (this is the status quo)
Not sure if anyone has an opinion of this? — Martin (MSGJ · talk) 19:30, 26 February 2024 (UTC)[reply]
I suspect the status quo is better (manual is better than incorrect automatic), but the cost of such errors appears to be low, so I don't hold the opinion strongly. — hike395 (talk) 09:08, 27 February 2024 (UTC)[reply]
I don't really mind either way. A few comments:
  • Wikipedia:Content assessment makes it clear that a SIA should be assessed as List-class.
  • If editors are trying to change that, it's probably because it's not really an SIA, in which case the template on the article should probably be changed.
  • A common issue is that editors try to rate them as Disambig-class instead. This causes issues because Disambig-class is automatically detected, and only when specific disambiguation templates are used on the article. Auto-assessing these as List-class might prevent this issue.
So we can either keep status quo (probably more straightforward) or we can start auto-assessing and be ready to revert if any problems/complaints arise. If no complaints, then it means it was the correct thing to do. — Martin (MSGJ · talk) 12:28, 28 February 2024 (UTC)[reply]

No further comments so I have implemented the code (without the SIA detection for now) — Martin (MSGJ · talk) 12:49, 1 March 2024 (UTC)[reply]

This is fine by me. My concern was articles being marked as unassessed when they were not. I think at redirect and disambig should be standard grades, but that a a debate for another place and time. Hawkeye7 (discuss) 21:00, 1 March 2024 (UTC)[reply]

Discussion about centralizing TemplateData for WikiProject banners[edit]

 You are invited to join the discussion at User talk:Evad37/rater.js § Aliases. Sdkbtalk 17:50, 14 February 2024 (UTC)[reply]

Not sure why Izno said it was impossible. I have made central documentation for a different module (see Module:Wikidata_table#L-650) that includes TemplateData for all its wrappers, and that seems to work well. Don't see why it couldn't be done here too — Martin (MSGJ · talk) 20:08, 14 February 2024 (UTC)[reply]
Please respond at the original discussion, per WP:TALKFORK. – Jonesey95 (talk) 04:11, 16 February 2024 (UTC)[reply]
It's a user talk page. Fine for brainstorming ideas, but if you want to progress anything then this is the page for that discussion ): — Martin (MSGJ · talk) 14:51, 16 February 2024 (UTC)[reply]
A user talk page for a widely used gadget/script. I think that page is preferable for the purposes of continuing an ongoing discussion.
As for why I said it was impossible, I am always happy to be proven wrong. What is certainly impossible is doing it without parsing the wikitext of the template in Lua, or a separate JSON page (at which point you might as well just plug in the TemplateData directly), or any of a variety of other things which are functionally equivalent to "you can't transclude <templatedata> and then extend a transclusion with the things that differ meaningfully". But now that you've split the discussion willfully, guess Sdkb will never know. :) Izno (talk) 21:51, 16 February 2024 (UTC)[reply]
I'm not a fan of talk forks like this, but thanks to the miracles of modern technology I'm plenty aware 🙂 Sdkbtalk 22:19, 16 February 2024 (UTC)[reply]
If you see what I did at Module:Wikidata table, I think it would be very feasible to do something similar in this module. But I'm struggling to understand the purpose, because I thought TemplateData is only used by Visual Editor which is only used in mainspace, whereas this template is used on talk pages. — Martin (MSGJ · talk) 23:18, 23 February 2024 (UTC)[reply]
Rater appears to use TemplateData based on Ctrl + F in the minified source at User:Evad37/rater/app.js. And no, it is not solely a tool for VE. Either way, centralized TemplateData doesn't work with the actual TemplateData editor. Which may or may not be fine, but is an additional hurdle for users who might wish to modify the descriptions of certain parameters further. Izno (talk) 00:18, 24 February 2024 (UTC)[reply]
Yeah, adding on to Izno's reply, my understanding is that TemplateData was originally created for the VisualEditor, but that it now has other applications like the Rater script. And I'd expect further applications in the future as we create new scripts/tools, so I think it's best to always create TemplateData so that there will be machine-readable standardized information for any script/tool that wants to use it. Cheers, Sdkbtalk 00:33, 25 February 2024 (UTC)[reply]
I personally find it very useful to have the parameters listed in the visual editor for WikiProject banner templates. I have added several TemplateDatas to several of the documentation pages and I would love to see it implemented universally. I have no clue how to go about doing it though. It is a wonderful world (talk) 21:19, 8 March 2024 (UTC)[reply]
As discussed above, visual editor is of no use to this template/module because it only exists on talk pages. The only use so far described, is possibly the Rater script. If there were more uses, it might make adding this more of a priority — Martin (MSGJ · talk) 20:05, 10 March 2024 (UTC)[reply]
Apologies, when I said "visual editor", what I really meant was the "Insert a template" puzzle piece button at the top of the visual and source editor. It is a wonderful world (talk) 21:51, 10 March 2024 (UTC)[reply]
Ooh, the mw:Help:Extension:TemplateWizard. I can't believe I've never noticed this or used it before. Okay, I will add this task to my to-do list or perhaps someone will get to it before me — Martin (MSGJ · talk) 22:28, 10 March 2024 (UTC)[reply]
Thank you very much. It's not a top priority obviously but it would be nice. It is a wonderful world (talk) 06:52, 11 March 2024 (UTC)[reply]

Proof of concept: try using {{WikiProject Norway/sandbox}} on a random talk page with the TemplateWizard. Only the class parameter is supported yet — Martin (MSGJ · talk) 22:18, 11 March 2024 (UTC)[reply]

Yes, this is exactly what I was envisioning. Thank you. It is a wonderful world (talk) 05:51, 12 March 2024 (UTC)[reply]
First iteration of this is now live. It will only work when |DOC=auto. It can be improved further but let me know what you think so far? — Martin (MSGJ · talk) 11:12, 15 March 2024 (UTC)[reply]
Just been testing it on WikiProject Zimbabwe and WikiProject Water Sports, and it works very well for me on both. Though, on WikiProject Zimbabwe, it has an example and information dialogue for the needs-infobox parameter, but not for the needs-photo parameter. Thank you. It is a wonderful world (talk) 13:23, 15 March 2024 (UTC)[reply]
Yeah it's not finished yet. You can add a description in line 669 of the code if you wish — Martin (MSGJ · talk) 16:59, 15 March 2024 (UTC)[reply]
Looks good. Following Wikipedia:TemplateData/Tutorial#Completing_the_template_data_information I'd change the "string" types to "line" and maybe mark the class as "deprecated" instead of "suggested" as we're moving it to the banner? Gonnym (talk) 18:34, 15 March 2024 (UTC)[reply]
Both good idea and  Done on the sandbox. The type:line doesn't seem to make any difference to the template wizard. — Martin (MSGJ · talk) 22:10, 15 March 2024 (UTC)[reply]

Template uses custom code to implement a custom quality rating, but it does not do it in the usual way with a custom mask. I'm not sure what to do with this template so dropping it here in case others have an idea. — Martin (MSGJ · talk) 23:15, 23 February 2024 (UTC)[reply]

@Kanashimi, @Qwerfjkl: please could you not remove any class parameter from this template until we figure out the best way to code it? It is using a custom mask, but not in the usual way. — Martin (MSGJ · talk) 20:56, 2 March 2024 (UTC)[reply]
Martin, I've stopped my bot, it's run on the vast majority of pages. — Qwerfjkltalk 20:58, 2 March 2024 (UTC)[reply]
Okay, wow. I didn't realise you had already finished! — Martin (MSGJ · talk) 20:59, 2 March 2024 (UTC)[reply]
Martin, yes, we've totally emptied the main two categories (in the main talk namepace). Around 4-5 million pages, I think. — Qwerfjkltalk 21:01, 2 March 2024 (UTC)[reply]
Yes, we've already processed a round of major categories. But I'm still on the task of removing obsolete parameters. I suggest adding {{Etymology section}} to Category:WikiProjects using a non-standard quality scale first. Kanashimi (talk) 22:53, 2 March 2024 (UTC)[reply]
How is that template not appearing in Category:WikiProject banners with non-standard names? Gonnym (talk) 13:33, 3 March 2024 (UTC)[reply]
The current logic is (args.PROJECT_NAME=='WikiProject '..project or not args.PROJECT_NAME) and current_page.rootPageTitle.prefixedText~='Template:WikiProject ' .. project In this case the project name is not WikiProject PROJECT and it is not undefined — Martin (MSGJ · talk) 13:56, 3 March 2024 (UTC)[reply]
Maybe adjust this so we check either if |PROJECT_NAME= is equal to "WikiProject project" OR the template name does not start with "WikiProject"? Since we standardized on "WikiProject project" for these templates, there really shouldn't be many with non-standard valid names I think, unless I missed something. Gonnym (talk) 15:23, 3 March 2024 (UTC)[reply]
This banner isn't for a WikiProject. Perhaps that issue should be corrected instead? Izno (talk) 17:53, 3 March 2024 (UTC)[reply]
Isn't it part of linguistics project? — Martin (MSGJ · talk) 19:22, 3 March 2024 (UTC)[reply]
A task force of that project, yes. Izno (talk) 22:11, 3 March 2024 (UTC)[reply]
I usually nominate task force banners to merge with their project banner but because this had manual code in it I left it alone for now as I didn't investigate what that code does and if indeed it needs manual code. Gonnym (talk) 06:52, 4 March 2024 (UTC)[reply]
I think I'll start by removing the custom code and attempting to use the standard methods. If that works then we can look at the next step — Martin (MSGJ · talk) 18:31, 4 March 2024 (UTC)[reply]
Conclusion: it is easy to convert it, but some categories would need to be renamed. Test cases at Template:Etymology section/testcases. I have also dropped a note on Wikipedia talk:WikiProject Linguistics. Also, there are only 141 pages using this template so it was never really adopted on any scale — Martin (MSGJ · talk) 18:47, 4 March 2024 (UTC)[reply]
Maybe after merging with {{WikiProject Linguistics}}, the syntax can be changed to something similar to this:
so instead of a new set of unique classes, it will just be another parameter that will trigger the placement in the category. Gonnym (talk) 10:02, 6 March 2024 (UTC)[reply]
Sounds like a good plan. I also think we could rename Category:Articles with mid-importance etymologies to Category:Mid-importance etymology articles or similar — Martin (MSGJ · talk) 10:30, 6 March 2024 (UTC)[reply]
I feel like those are just other ways to grade each article with a class, which we have examples of for task forces. Good would put it in B, incomplete C or start, unassessed is missing a grade, and missing is probably equivalent to unassessed ultimately... Izno (talk) 17:17, 6 March 2024 (UTC)[reply]
That's also a good point. Gonnym (talk) 07:19, 7 March 2024 (UTC)[reply]
Missing etymology might just be like |needs-infobox= I guess, but the rest all have direct analogs to our rating system. Izno (talk) 16:32, 7 March 2024 (UTC)[reply]

Execution time[edit]

I've recently been looking into the execution time of this module due to a couple of lua timeout errors occassionally popping up on larger pages with a lot of banner templates (e.g. 1, 2, 3 (not entirely wpb's fault)). I've already proposed a change to a module this module uses which should solve the issue well enough, but I think it's still worth looking into optimising this code.

I've noticed that this module can call Pagetype (which is intensive in comparison to most things required) on the same page up to (but not always) 3 times while handling a banner (see lines 161, 299, and 327). Considering 2 of them are caused by calling class_mask (definitely a duplicate pagetype call we don't need to make), I feel like it should be possible to reduce the max calls to 2, but the functionality of some of this module is beyond me (no clue what FQS means to start with), so I'm not confident I could optimise this myself without breaking some sort of functionality. Could someone consider taking a look at this? Aidan9382 (talk) 22:16, 21 March 2024 (UTC)[reply]

I guess it should be possible to reduce the calls to pagetype to 1. I'll have a look when I get a chance — Martin (MSGJ · talk) 22:38, 21 March 2024 (UTC)[reply]
Okay please have a look at my changes in the sandbox. There would need to be a minor change to Module:Banner shell at the same time — Martin (MSGJ · talk) 12:32, 22 March 2024 (UTC)[reply]
No comment on functionality, but I imagine there are testcases for this module in terms of that (though unless there was some sort of super specific scenario where the main function specifically but not the class mask wanted to ignore disambiguation, I doubt anything is broken). Thanks to this change and a change in a different module, the sandbox version is now running about 6.5 times faster than the live version in the worst case scenario (significantly large pages, all 3 pagetype calls - I'm using Talk:List of common misconceptions for my testcases), which is a huge improvement, so thanks for doing that. I'd recommend updating banner shell before this module whenever that happens so there isn't a small window where stuff breaks. Aidan9382 (talk) 17:04, 22 March 2024 (UTC)[reply]
Great. I've implemeneted your changes to pagetype. I will have a look to see if any other changes are needed to banner shell and then probably do that one later today. Can I ask how you came across Talk:List of common misconceptions and discovered the issue? By the way, when we have resolved all the conflicting article ratings, I hope we will be able to improve efficiency by just doing the quality assessment once (on the banner shell) rather than having to it on each individual banner — Martin (MSGJ · talk) 19:30, 22 March 2024 (UTC)[reply]
I came across that talk page since my bot, which handles bad archive values in {{User:MiszaBot/config}} as one of its tasks, kept throwing warnings for pages that had appeared in a tracking category despite having what it (correctly) thought was the already right input (you can see the result of me purging some of the pages to temporarily remove the timeout in Special:Diff/1214818416). I just removed templates and used show preview till I found what was responsible for the majority of the execution time, which is why I've been improving the execution time of multiple modules recently. Aidan9382 (talk) 19:39, 22 March 2024 (UTC)[reply]
New code deployed, so hopefully that reduces the lag on these pages — Martin (MSGJ · talk) 21:06, 24 March 2024 (UTC)[reply]
Thanks, stuff's looking much better now (not even 2s on the misconceptions page compared to over 6s before the updates). Aidan9382 (talk) 21:28, 24 March 2024 (UTC)[reply]