Module talk:WikiProject banner/Archive 15: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Module talk:WikiProject banner) (bot
m Archiving 1 discussion(s) from Module talk:WikiProject banner) (bot
Line 283:
::::::::Deployed to live &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 14:45, 2 September 2024 (UTC)
:::::::::Thanks. [[User:Primefac|Primefac]] ([[User talk:Primefac|talk]]) 14:52, 2 September 2024 (UTC)
 
== Modifying the module so default values aren't needed to be set ==
 
The advantage of invoking the module directly from banner templates is that we don't need to add default values for many of the parameters, so code like <code>|category = <nowiki>{{{category|}}}</nowiki></code> isn't needed as the module knows it received a parameter with that name. Removing the need to add default parameters like this will make the long and complex banner code easier (and cleaner) to read.
 
Currently we have 4 types of parameters (if I'm not mistaken):
# Parameters that all banners have and use the same parameter name.
# Parameters that all banners have but use various names.
# Parameters that some banners have but use the same name.
# Parameters that some banners have but use various names.
 
The change needed would be like this:
* Group 1 is the ideal and easiest candidate to convert. Parameters in this group probably include {{para|category}} and {{para|listas}}.
* Group 3 is also easy to convert. Instead of doing something like <code>|class = <nowiki>{{{class|}}}</nowiki></code>, we can change to <code>|class = yes</code>. Parameters in this group probably include {{para|class}} and {{para|importance}}.
** In some cases where the parameter is almost always used, the default can be yes anyways so only when it isn't needed, the banner should set <code>|class = no</code>, reducing the banner code even more.
* For group 2 and 4, this change will make things more consistent across all banners so instead of something like <code>|image-needed = <nowiki>{{{image|{{{image-needed|{{{needs-image|}}}}}}}}}</nowiki></code> it will be <code>|image-needed = yes</code> with only one of these names (or we could still leave all versions, messy but works).
[[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 11:13, 3 September 2024 (UTC)
 
:Nice ideas. Just a few comments at this stage.
:* These templates follow a long-standing convention of using upper-case parameter names for configuration settings and lower-case parameter names for passing values. So perhaps {{para|CLASS|yes}} would be more respectful of that convention, if we wish to retain it.
:* I would prefer to default to "no" in almost every case. There are already plenty of cases of editors using features that they don't actually need.
:* I can't think of any examples of group 2?
:* I suppose the module could check for all reasonable variants of parameter names, e.g. image, imageneeded, image-needed, etc. Or are you suggesting a harmonisation effort?
:* For group 4, we could do something like {{para|TF_1|utah}} which would tell the module to check the {{para|utah}} parameter and link it to task force 1.
:* Currently the module does not look at any of the parent frame arguments (i.e. parameters passed from a page), it only looks at the frame arguments (i.e. parameters passed from the template), so this would need a fairly major restructure of the code
:&mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 11:25, 3 September 2024 (UTC)
::* #1: That can work and would also make the conversion smoother as both parameters can work until all banners are converted.
::* #2: A blanket no would be counter-productive here. class is used in almost all banners but a few. Having this line added to all of them instead of only the handful that don't need it is less ideal.
::* #3: Probably one word parameters, so something like {{para|attention}}.
::* #4: I'd prefer we harmonize on one name, yes. But that's my personal preference here. Having the module know all versions can work, but will be ugly and messy.
::[[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 11:34, 3 September 2024 (UTC)
:::Ha, your edit to the sandbox will definitely not work without significant other changes! For example it would allow you to use features that the project does not even use. Let's start on a small scale with group 1.
:::* listas - I would prefer to move all these to the banner shell and then delete from the banners. So let's work on tracking these instead?
:::* substcheck - I have a feeling there is now a ''much'' better way to detect if a template has been substituted. So maybe look into that, and hopefully we can do without this parameter altogether.
:::* category - this would be a good one to start with, and would prove the concept.
:::* demo_page - this is undocumented, but very useful when testing to see how banners behave on different pages. It would be useful if we could use this parameter directly without having to pass through the template.
:::&mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 19:22, 3 September 2024 (UTC)
::::The edit was just to see if the basic thing breaks (which it didn't so that's good news). If a project banner doesn't support a parameter (as in, the parameter isn't one of the default parameters, or isn't set to "on") then using it from a talk page shouldn't do anything other than place that parameter in the unknown parameter category. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 23:01, 3 September 2024 (UTC)
If we start using {{para|CLASS|yes}} then it might be a good time to stop using {{para|class}} altogether, because all of the ratings should now be in the banner shell so this parameter is not needed. The only barrier to this is [[:Category:Articles with conflicting quality ratings]] which is a massive barrier, and we have made almost no progress in resolving ... &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 07:42, 4 September 2024 (UTC)
 
:Could you in the code sort the pages by the conflicting class? That would probably make it easier to see what issues can be solved with a bot run. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 08:34, 4 September 2024 (UTC)
::Could sort by class, or alternatively the number of classes that it differs from the PIQA rating (e.g. if class=start and PIQA=B then difference=2). Or we could put use subcategories like [[:Category:Articles with conflicting quality ratings that differ by 1 class]], etc. &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 09:40, 4 September 2024 (UTC)
:::I'd prefer not a number as that doesn't give us any information to work with. A class can show us patterns. This [[Talk:1876 United States presidential election in Rhode Island]], for example, is not a list. If we can single these out then we can start clearing them. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 09:58, 5 September 2024 (UTC)
::::Okay that's fine. But sorting by class is problematic before start/stub and fa/fl start with the same letters. What sort keys would you like to use? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 11:32, 5 September 2024 (UTC)
:::::It doesn't matter to me, as long as they are different. I'm also quite sure we won't have more than a handful of articles with FA/FL issues, if at all. Maybe place stub as 0. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 11:40, 5 September 2024 (UTC)
::::::With [https://en.wikipedia.org/w/index.php?title=Module:WikiProject_banner/sandbox&diff=prev&oldid=1244520973 this edit] we could split out the category into different classes? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 16:23, 7 September 2024 (UTC)
::::::The subcategories of [[:Category:Articles with conflicting quality ratings]] have now populated &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 14:36, 12 September 2024 (UTC)
:::::::Looking at the 3k pages at [[:Category:List-Class articles with conflicting quality ratings]]. I think we can safely have a bot run and remove the pages marked as list from all pages except those in the format of "x in y" ([[Talk:1962 in anime]]). There might be some false positives, but that isn't something that can't be fixed manually when someone sees it. All the others aren't lists, but low-quality articles.
:::::::The pages in [[:Category:GA-Class articles with conflicting quality ratings]] seem to be Military History articles tagged as "A". So in this case (and probably also in all other categories) we can decide to go with the higher tagged page, as an editor intentionally decided that article was that level (it's not our job here to check if we agree or not, just to fix the conflict). The stub pages can be double checked if the article itself still has a stub template, if it doesn't, it's not a stub. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 16:28, 12 September 2024 (UTC)
::::::::I like these suggestions &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 17:34, 12 September 2024 (UTC)
The code for using parent arguments for category and demo_page is now coded on sandbox, if you'd like to check it &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 21:09, 5 September 2024 (UTC)
 
:Tested the category=no at [[Draft talk:Template:Test banner]] and looks good. [[User:Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) 15:47, 6 September 2024 (UTC)