Wikipedia:Bots/Requests for approval/DeprecatedFixerBot 2
Operator: TheSandDoctor (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 16:40, Wednesday, March 14, 2018 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): Python
Source code available: https://github.com/TheSandDoctor/DivCol-ColumnsList-Fix
Function overview: Remove deprecated parameters from both Template:Columns-list and Template:Div col transclusions, as found in Category:Pages using Columns-list with deprecated parameters and Category:Pages using div col with deprecated parameters
Links to relevant discussions (where appropriate): Template talk:Div col#Proposal for standardized changes (by bot or AWB)
Edit period(s): Routine runs until categories are cleared, possible maintenance runs in future
Estimated number of pages affected: 57,000+
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): No, needs flag
Function details: The bot would run through one category at a run in a series of subsequent runs.
As described in the linked discussion,
{{div col|2}} → {{div col}} {{div col|cols=2}} → {{div col}} {{colbegin|2}} → {{div col}} {{colbegin|cols=2}} → {{div col}} (etc. for other redirects) {{colbegin|3}} (or cols=3) → {{div col|colwidth=22em}} {{colbegin|4}} (or cols=4) → {{div col|colwidth=18em}} {{colbegin|5}} (or cols=5) → {{div col|colwidth=15em}} {{colbegin|6}} (or cols=6) → {{div col|colwidth=13em}} {{colbegin|7+}} (or cols=7+) → {{div col|colwidth=10em}} (any number of columns 7 or higher) {{Columns-list|2| → {{Columns-list|colwidth=30em| (while we're here; also do for all redirects to this one) {{Columns-list|3| → {{Columns-list|colwidth=22em| (and etc. as below) {{div col||([0-9]em)}} → {{div col|colwidth=$1}} {{div col|([0-9]em)}} → {{div col|colwidth=$1}} (as currently coded, this is an error, but fixable) {{colend}} → {{div col end}} (replace all end template redirects with div col end)
If the bot finds the first unnamed parameter, it assesses its value. If the value is less than 2 (1), then it removes that parameter so the template is set to its default value. If the value is between 2 and 6, it changes as shown above. If the value is 7 or greater, then the bot changes the value to 10em.
In offline tests (printing both input and output to individual local files on a random few), it worked as expected.
Discussion
- If you would like a dry run with outputted files put in the GitHub repository, I would certainly be open to doing that. --TheSandDoctor (talk) 16:48, 14 March 2018 (UTC)
@TheSandDoctor: Per WP:BOTACC "The account's name should identify the bot function (e.g. <Task>Bot), or the operator's main account (e.g. <Username>Bot)." I would find it extremely confusing if a Twitter-related bot started to do div-related changes. We need either a new bot account, or a rename of the existing bot account (such as TheSandDoctor's Bot / TheSandDoctorBot or similar). This also applies to Wikipedia:Bots/Requests for approval/TweetCiteBot 2. Headbomb {t · c · p · b} 21:33, 17 March 2018 (UTC)
- Moved task from TweetCiteBot to DeprecatedFixerBot. --TheSandDoctor (talk) 21:59, 17 March 2018 (UTC)
I'm a bit concerned this could fall under WP:CONTEXTBOT. I can conceive of cases where exactly two or exactly three columns is what is meant, rather than a more lax "well on my screen, 3 columns looks nicer so let's go with that". You might argue that those should be done with different templates, but how would the bot deal with something like say
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
Headbomb {t · c · p · b} 17:08, 21 March 2018 (UTC)
- @Headbomb: It would just remove "cols" and use the default, nothing would visibly change (aside from a slight shift left on my screen at least, but barely noticeable).
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
- Like that. --TheSandDoctor Talk 17:23, 21 March 2018 (UTC)
- What about the 3 column output then (updated my example)? Also this seems to contradict the listed logic "{{div col|cols=2}} →
{{div col}}{{div col|colwidth=30em}}"Headbomb {t · c · p · b} 17:53, 21 March 2018 (UTC)- Headbomb, please read the linked discussion above. Specifying a number of columns is deprecated behavior, for the same reason that the behavior was deprecated (and removed) in {{reflist}}. This is just a continuation of that work. – Jonesey95 (talk) 18:16, 21 March 2018 (UTC)
- @Jonesey95: I agree it's deprecated, what IOwant to know is how the bot deals with when this is intended behaviour and either screws up with that intended behaviour, or how it avoids screwing up with that intended behaviour. The discussion offers no insight on this. Headbomb {t · c · p · b} 19:12, 21 March 2018 (UTC)
- @Headbomb: It would look like this
- Headbomb, please read the linked discussion above. Specifying a number of columns is deprecated behavior, for the same reason that the behavior was deprecated (and removed) in {{reflist}}. This is just a continuation of that work. – Jonesey95 (talk) 18:16, 21 March 2018 (UTC)
- What about the 3 column output then (updated my example)? Also this seems to contradict the listed logic "{{div col|cols=2}} →
- Team A
- Alice
- Bob
- Charles
- Team B
- Denver
- Emily
- Fiona
- Team C
- Gilligan
- Hector
- Ines
- I was hesitant in responding until I figured out the issue. For some reason, when I previously set colwidth to 22em, it just gave a vertical list, yet now it posts normally. Clearly I did something wrong. Either way, works now? (cc @Jonesey95: --TheSandDoctor Talk 18:20, 21 March 2018 (UTC)
- Also, sorry about the contradictions, they have now been resolved. --TheSandDoctor Talk 18:21, 21 March 2018 (UTC)
- I was hesitant in responding until I figured out the issue. For some reason, when I previously set colwidth to 22em, it just gave a vertical list, yet now it posts normally. Clearly I did something wrong. Either way, works now? (cc @Jonesey95: --TheSandDoctor Talk 18:20, 21 March 2018 (UTC)
So what's the plan for avoiding the issue of screwing up intentionally specific column numbers? Or dealing with screwups when they happen? Headbomb {t · c · p · b} 19:09, 21 March 2018 (UTC)
- Can you please clarify what a "screwup" would look like? If you mean converting "cols=2" to "colwidth=30em", that is not a screwup, that is the consensus of the editors at the linked discussion. Specifying a fixed number of columns using the {{div col}} template is deprecated behavior (see the template's documentation) that is being removed. Since there are 40,000 articles that use deprecated parameters in the template, a bot is the least disruptive way to make that change. – Jonesey95 (talk) 20:20, 21 March 2018 (UTC)
- I've already clarified above with the 3 column example above. The 3 columns in that case would be intentional, and it is not something that converted to 22em because it screws up the intended layout (zoom in/out of the page to see that it's messed up). So the question is how does the bot plan on either a) avoiding those sort of edits or b) providing a way for editors to restore the fixed-column format when it was intended / is desired, without the bot edit-warring with them over and over. Headbomb {t · c · p · b} 20:39, 21 March 2018 (UTC)
- Thank you. The example was not clear to me, because the "after the bot" example used div col without any parameters, which is not how the bot will work. I have added colwidth=22em to the "after" example, and the columns look the same to me on my normal-sized screen.
-
- I see what you mean about zooming in and out, but that is the best compromise. The cols=3 format fails on mobile (it displays only one column), so it is already broken. It has been deprecated for four years for this and other reasons, so editors have had plenty of time to make other choices. Changing to use colwidth makes div col work better on a wider variety of devices. If people want fixed columns, they need to use one of the other templates listed in the See also section of the documentation. – Jonesey95 (talk) 20:52, 21 March 2018 (UTC)
- Then the bot should point to that documentation, either with instructions on the bot page on what to do when the bot touches something people don't want touched, similar to this, or with an edit summary link to the documentation which points to the templates people can use to create fixed columns. Or both. Headbomb {t · c · p · b} 21:02, 21 March 2018 (UTC)
- Good idea. I have updated the template documentation to clarify how to get a fixed number of columns. The bot's edit summary should contain a link to the template. – Jonesey95 (talk) 21:15, 21 March 2018 (UTC)
Approved for trial (10 edits for each "type" of edits listed above.). Please provide a link to the relevant contributions and/or diffs when the trial is complete. That works for me. The edit summary should specifically point to Template:Div col#Usage of "cols" parameter as a resource link for editors. Headbomb {t · c · p · b} 21:21, 21 March 2018 (UTC)
- @Headbomb:
Could you please clarify "type"? Pages with 1-10 as the cols parameter or? --TheSandDoctor Talk 00:30, 22 March 2018 (UTC)You mean 10 * number of "types" specified in the original list in nomination, correct? --TheSandDoctor Talk 01:04, 22 March 2018 (UTC)
- @Headbomb:
- Good idea. I have updated the template documentation to clarify how to get a fixed number of columns. The bot's edit summary should contain a link to the template. – Jonesey95 (talk) 21:15, 21 March 2018 (UTC)
- Then the bot should point to that documentation, either with instructions on the bot page on what to do when the bot touches something people don't want touched, similar to this, or with an edit summary link to the documentation which points to the templates people can use to create fixed columns. Or both. Headbomb {t · c · p · b} 21:02, 21 March 2018 (UTC)
- I see what you mean about zooming in and out, but that is the best compromise. The cols=3 format fails on mobile (it displays only one column), so it is already broken. It has been deprecated for four years for this and other reasons, so editors have had plenty of time to make other choices. Changing to use colwidth makes div col work better on a wider variety of devices. If people want fixed columns, they need to use one of the other templates listed in the See also section of the documentation. – Jonesey95 (talk) 20:52, 21 March 2018 (UTC)
- I've already clarified above with the 3 column example above. The 3 columns in that case would be intentional, and it is not something that converted to 22em because it screws up the intended layout (zoom in/out of the page to see that it's messed up). So the question is how does the bot plan on either a) avoiding those sort of edits or b) providing a way for editors to restore the fixed-column format when it was intended / is desired, without the bot edit-warring with them over and over. Headbomb {t · c · p · b} 20:39, 21 March 2018 (UTC)