Misplaced Pages

Module talk:Storm categories: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 22:48, 12 April 2023 editChlod (talk | contribs)Extended confirmed users, New page reviewers, Pending changes reviewers, Rollbackers, Template editors17,659 edits Accidental short-circuit in ternary expressions at lines 51 and 73← Previous edit Revision as of 22:50, 12 April 2023 edit undoChlod (talk | contribs)Extended confirmed users, New page reviewers, Pending changes reviewers, Rollbackers, Template editors17,659 edits Accidental short-circuit in ternary expressions at lines 51 and 73: nevermindNext edit →
Line 114: Line 114:
This module has a mistake at lines 51 and 73, in the instances of {{code|1=or (nullIfMissing and nil or )|lang=lua}}; these lines attempt to output <code>nil</code> if <code>nullIfMissing</code> is truthy and otherwise <code></code>, but because nil is falsy, the <code>or </code> will always trigger, and as such the expression simply short-circuits to <code>or </code>. {&#123;''']'''&#124;]&#124;]&#125;} 22:20, 12 April 2023 (UTC) This module has a mistake at lines 51 and 73, in the instances of {{code|1=or (nullIfMissing and nil or )|lang=lua}}; these lines attempt to output <code>nil</code> if <code>nullIfMissing</code> is truthy and otherwise <code></code>, but because nil is falsy, the <code>or </code> will always trigger, and as such the expression simply short-circuits to <code>or </code>. {&#123;''']'''&#124;]&#124;]&#125;} 22:20, 12 April 2023 (UTC)


:{{re|Lemondoge}} Good catch; didn't notice that. Luckily that code path only gets executed when the module is being called by another module (and not when the main templates are being used), so this hopefully hasn't been causing issues. :{{re|Lemondoge}} Good catch; didn't notice that.
:{{tper}} :{{tper}}
:Line 51 to: :Line 51 to:

Revision as of 22:50, 12 April 2023

Module:Storm categories is permanently protected from editing because it is a heavily used or highly visible module. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit.

WikiProject iconWeather: Tropical Template‑class
WikiProject iconThis module is within the scope of WikiProject Weather, which collaborates on weather and related subjects on Misplaced Pages. To participate, help improve this article or visit the project page for details. WeatherWikipedia:WikiProject WeatherTemplate:WikiProject WeatherWeather
TemplateThis module does not require a rating on Misplaced Pages's content assessment scale.
Taskforce icon
This module is supported by WikiProject Tropical cyclones.

Template-protected edit request on 11 April 2022

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Given the concerns regarding the changed colors and their relation to the ongoing ArbCom case against WPTC regarding stealth canvassing (which the process was heavily tainted by) – brought up here, here and here (the last one brought up by me specifically to get more input from members) – I propose that until the ArbCom case is finalized on May 4 (under a month from now) the legacy colors be temporarily restored until a decision on what to do regarding the RfC’s outcomes is made. The reasoning behind this is mostly to fix the discrepancy between the infoboxes/timelines and the track maps themselves, given that the project was in the middle of re-discussing a new scheme after the previous consensus and had not updated the maps. Even now, currently active systems are still using the old color scale for the track maps so I think it is better that at least for the next month we follow that so as to not give confusion to new readers. This is a genuine concern and not a case of WP:IDLI as I am considering the ramifications the currently convoluted situation has right now on our new readers. MarioProtIV (/contribs) 15:29, 11 April 2022 (UTC)

Please keep this to a single discussion where you initially posted. ~ Cyclonebiskit (chat) 17:38, 11 April 2022 (UTC)
 Not done. We are not doing this. The proper process for an RfC is consensus first, then implementation of said consensus. In the meantime, the status quo should be upheld. It is far, far more disruptive to revert back and forth than it is to keep the current changes in place. LightandDark2000 🌀 (talk) 19:19, 11 April 2022 (UTC)

Template-protected edit request on 2 September 2022

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Please add the icon for the "vstyphoon" category (around line 196):

		name = "Very strong typhoon",
		sortkey = 60020,                                    -- modified line (added comma)
		icon = "]" -- added line
	},

and the icon for the "vityphoon" category (around line 201):

		color = "C464D9",
		name = "Violent typhoon",
		sortkey = 60030,                                -- modified line (added comma)
		icon = "]" -- added line
	},

Chlod (say hi!) 04:33, 2 September 2022 (UTC)

Chlod, could you please clarify: after the proposed changes are applied, will the overrides from Special:Diff/1069592996/1107665379 need to be removed? —⁠andrybak (talk) 07:27, 2 September 2022 (UTC)
@Andrybak: Well, they should be removed since an override would no longer be needed. It won't immediately break if there is a conflict. Chlod (say hi!) 07:31, 2 September 2022 (UTC)
 Done —⁠andrybak (talk) 13:52, 2 September 2022 (UTC)
Thank you very much! Chlod (say hi!) 13:54, 2 September 2022 (UTC)

Template-protected edit request on 11 October 2022

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Could someone please revert the color changes I made on March 18, 2022, at Module:Storm categories/categories per Wikipedia_talk:WikiProject_Weather#RfC:_Full-scale_reversion? All colors should be reverted to their pre-March 18 values per the SNOW support at that discussion. Please be careful to not remove any other additions to this module since then. Noah 17:25, 11 October 2022 (UTC)

 Done I think I found the right changes to make, but it is always a lot easier if you make the proposed changes in a sandbox and show it working on a testcases page. Please ping me if I made any unwanted changes. – Jonesey95 (talk) 18:48, 11 October 2022 (UTC)
Hi, @Jonesey95! You accidentally reverted a few additions made earlier this year. Special:PermanentLink/1115566090 on the sandbox page has the corrected module code. Previews are on Module:Storm categories/demo/sandbox. Please make the edit when you find the time. Thanks! Chlod (say hi!) 03:23, 12 October 2022 (UTC)
 Done. I think I've got it this time. If not, you know how to find me. – Jonesey95 (talk) 04:38, 12 October 2022 (UTC)

PTS colors

Just to raise awareness in a fourth location, I will link the discussion regarding the pink Pacific typhoon season color scale here, as well. – atomic𓅊7732 12:57, 28 November 2022 (UTC)

Template-protected edit request on 3 December 2022

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Please place the following line to alias the formerly-documented vstrtyphoon code (from Special:Diff/618384846, later commented out) to vstyphoon, preferably above line 571.

cats = cats

Chlod (say hi!) 13:43, 3 December 2022 (UTC)

 Completed. P.I. Ellsworth , ed.  18:23, 3 December 2022 (UTC)

Template-protected edit request on 6 February 2023

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Please change the name for "unknown" to "Unknown-strength storm" from "Unknown strength tropical cyclone". This module now includes much more than tropical cyclones, and the fallback should reflect the switch to a more general term.

    -- ...
	unknown = {
		color = "c0c0c0",
		name = "Unknown-strength storm",
    -- ...

Thank you! Chlod (say hi!) 00:26, 6 February 2023 (UTC)

 Completed, and thank you very much! P.I. Ellsworth , ed.  02:33, 6 February 2023 (UTC)

Edit request 24 February 2023

This edit request to Module:Storm categories/categories has been answered. Set the |answered= or |ans= parameter to no to reactivate your request.

Description of suggested change:

Please substitute the preexisting colors in this template with the new colors agreed upon through RfC and further discussion, at Misplaced Pages:WikiProject_Weather/Color_RfC#Modification. To simplify:

  • Entries with the color #80ccff should be changed to #0084D6
  • Entries with the color #5ebaff should be changed to #6EC1EA
  • Entries with the color #00faf4 should be changed to #4DFFFF
  • Entries with the color #ccffff should be changed to #C0FFC0
  • Entries with the color #ffffcc should be changed to #FFFFD9
  • Entries with the color #ffe775 should be changed to #FFD98C
  • Entries with the color #ffc140 should be changed to #FF9E59
  • Entries with the color #ff8f20 should be changed to #FF738A
  • Entries with the color #ff6060 should be changed to #8D75E6

That's a lot, I know, so thank you! wxtrackercody (talk · contributions) 01:15, 24 February 2023 (UTC)

Any chance you could make the changes to Module:Storm categories/colors/sandbox? — Martin (MSGJ · talk) 19:42, 24 February 2023 (UTC)
@MSGJ: Module:Storm categories/categories is the correct location for where changes should be made. I am adding them to the appropriate sandbox as we speak. Should be done in about 10 minutes. Noah 19:53, 24 February 2023 (UTC)
@MSGJ: I believe I have changed everything correctly. Noah 20:09, 24 February 2023 (UTC)
 Done — Martin (MSGJ · talk) 22:39, 24 February 2023 (UTC)
@MSGJ: Actually, it appears wxtrackercody was mistaken on some of the values given what was listed in the table (looks isolated to southern hemisphere TCs and north indian ocean TCs at the upper levels in their scales) so I need to go back and correct those. Sorry about that. Noah 23:03, 24 February 2023 (UTC)
@MSGJ: All values should be corrected now. Again, sorry. I would have caught this had I been able to see a preview of the main module where it displays all the values, but alas that wasn't possible. Noah 23:13, 24 February 2023 (UTC)
Also appears another issue is located at Module:Storm categories/colors. The value 80ccff needs changed to 0084D6 (there's only one occurrence here) in order to stop it from overriding the input at the other module page. Noah 00:09, 25 February 2023 (UTC)
@Hurricane Noah and Wxtrackercody: Another issue is that text does not show up well with the C5 color as background. For example, try reading "F5" on individual tornadoes' info-boxes. CapeVerdeWave (talk) 00:27, 25 February 2023 (UTC)
@CapeVerdeWave: black text on the Cat 5 color background has a contrast ratio of 5.81:1, well above the threshold of 4.5:1 for WCAG 2.0 level AA as required by WP:ACCESS. wxtrackercody (talk · contributions) 00:33, 25 February 2023 (UTC)
@CapeVerdeWave and Wxtrackercody: Yes I notice that now. It must be an issue related to how WP displays it since it is AA compliant. We likely just need to use a slightly lighter value for templates while keeping the original for the maps since there isn't text there.   would likely be favorable for black text on wiki while not being drastically different from the map color. I went ahead and added it to the sandbox since it's not a significant change from the original color we approved and we need to make sure everything can be read easily. Noah 00:34, 25 February 2023 (UTC)

Re-filed edit request

Please apply the changes currently on the sandbox (Module:Storm categories/categories/sandbox), per the above. Thank you! Chlod (say hi!) 10:06, 25 February 2023 (UTC)

Please check Module:Storm categories/sandbox#Full list of available values and confirm all are now correct? There is still a "#80ccff" for "d" - is that right? — Martin (MSGJ · talk) 10:28, 25 February 2023 (UTC)
@MSGJ: It seems @Hurricane Noah forgot to account for overridden colors; the change has been made to Module:Storm categories/colors/sandbox. Please apply the changes to Module:Storm categories/colors as well. Thank you! Chlod (say hi!) 10:34, 25 February 2023 (UTC)
All values should be correct now and work with the black text. Noah 15:55, 25 February 2023 (UTC)
 Done — Martin (MSGJ · talk) 16:16, 25 February 2023 (UTC)
Thanks. Noah 16:17, 25 February 2023 (UTC)

Accidental short-circuit in ternary expressions at lines 51 and 73

This module has a mistake at lines 51 and 73, in the instances of or (nullIfMissing and nil or ); these lines attempt to output nil if nullIfMissing is truthy and otherwise , but because nil is falsy, the or will always trigger, and as such the expression simply short-circuits to or . {{Lemondoge|Talk|Contributions}} 22:20, 12 April 2023 (UTC)

@Lemondoge: Good catch; didn't notice that.
It is requested that an edit be made to the template-protected module at Module:Storm categories.
(edit · history · last · links · sandbox · edit sandbox · sandbox history · sandbox last edit · sandbox diff · test cases · transclusion count · protection log)

This template must be followed by a complete and specific description of the request, so that an editor unfamiliar with the subject matter could complete the requested edit immediately.

Edit requests to template-protected pages should only be used for edits that are either uncontroversial or supported by consensus. If the proposed edit might be controversial, discuss it on the protected page's talk page before using this template. Consider making changes first to the module's sandbox and test them thoroughly here before submitting an edit request. To request that a page be protected or unprotected, make a protection request. When the request has been completed or denied, please add the |answered=yes parameter to deactivate the template.

Line 51 to:
			or (not nullIfMissing and error("No default name for basin-based category name.") or nil)
Line 73 to:
	) or (not nullIfMissing and cats.icon) or nil)
per the above. Chlod (say hi!) 22:48, 12 April 2023 (UTC)
Categories: