Template talk:Signpost/Days left color

Incorporating
Going through the roster of Signpost pages, I find this -- looks like it is a fork of User:Bri/Days Left Percent, which is called by Signpost/Deadline, which is called by every sucker on the subway (100 transclusions even). I don't think it is great to have template internals be transcluding stuff from userspace. What do you say to incorporating this into the deadline template and removing the userspace page? jp×g 07:29, 22 July 2023 (UTC)


 * That was originally sort of my plan, yeah. My thinking was that, if both and  could be taught to accept full date strings, the same way the Signpost templates themselves do, then the  code could be immensely simplified to not have to break out the individual, , etc. parameters at all. Those only exist because they're needed as parameters when calling , which  still does, twice. (It, in turn, calls .)
 * I'd attempted to contact Bri about the templates, but my query got archived without response. Feeling anxious about possibly stepping on any toes by (a) appropriating the code for, (b) modifying, and (c) displacing the calls to, Bri's userspace templates without at least tacit approval (which an unanswered talk page message didn't feel like), I sort of let it drop. But that doesn't mean I don't still think it's a good idea both to migrate them into Signpost space, and to update their code to accept full date strings.
 * (I should check how far I got on that second part, as I simply don't remember. ...Ah, I did complete that work, it seems! I just need to change this template to call instead of, as I've since migrated my sandbox edits to accept full-date strings there to the main template.)
 * If we wanted to completely move off of userspace templates, (my full-dates clone of ) still calls, which would also have to be cloned into either Template:Signpost/ space or the Template namespace.
 * (Or maybe not. Come to think of it, actually only exists, in Signpost context, to provide arguments to . In theory, we could cut out the middleman there by just moving this template to "Signpost/Days left color", and have it do the work of both templates by directly outputting hex color values instead of percentages.)
 * Anyway, I'm willing to finish up the work of migrating away from Bri's userspace templates, if it's generally agreed to be useful and appropriate. That uncertainty, more than anything technical, was the main reason I stopped work on these way back when. FeRDNYC (talk) 13:25, 22 July 2023 (UTC)
 * I think that, more than anything else, the primary issue the Signpost faces is the accumulated burden of twenty years of technical debt -- of which the difficulty communicating about technical stuff like obscure template workings is a symptom. It seems very suboptimal ("pessimal", perhaps) for there to be a situation in which fixing jacked-up templates requires us to traipse around in other people's userspace lol. Frankly, the sooner we can fix this the better. There's nothing in Wikipedia Signpost/Technical about the deadline templates because they were literally too much of a mystery for me to figure out -- if we can simplify them, all the better. In any case, if anybody gets mad (which I don't think will happen) feel free to hide behind the skirts of the editor-in-chief :^) jp×g 20:08, 22 July 2023 (UTC)
 * That was a complete lie! (He realized, immediately after moving this template.)
 * S'okay, though, I covered by restoring the code over the redirect, and rewriting this template so that it uses that template to perform its calculations. It's no longer a generic "turn percentage value into hex color" template like  is, but that's fine.
 * I also finished all the rest of the adjustments I needed to make to the various Template/Signpost/ subpages, new and old. With that done, is a new version of the core code which depends — directly or indirectly — only on templates in the Template namespace. Primarily the ones linked above, but also (still), , , , etc.
 * I'm just about ready to make it live, now that they've reached feature parity:
 * That'll let me cut... 15 parameters, from what currently generates. (A set that recently grew by three more, to 27. The three additions replace all of the ones I can now cut. So, now it'll be "only" 12. Could be a lot less, but  is the lone outlier that still requires separate parameters for each date/time component.) FeRDNYC (talk) 23:25, 1 August 2023 (UTC)
 * ✅ Now all that's left is everybody's favorite part... writing documentation for all of the new templates. *sigh* (Arguably should've been done before they were activated. But, counter-argument: It wasn't.) FeRDNYC (talk) 01:55, 2 August 2023 (UTC)
 * How much smarter would it have been if I'd 'd those examples above, so they weren't invalid now that the sandbox code has been copied to the live template? *sigh* Oh, well. At least I got all of the documentation done. FeRDNYC (talk) 15:56, 2 August 2023 (UTC)
 * That'll let me cut... 15 parameters, from what currently generates. (A set that recently grew by three more, to 27. The three additions replace all of the ones I can now cut. So, now it'll be "only" 12. Could be a lot less, but  is the lone outlier that still requires separate parameters for each date/time component.) FeRDNYC (talk) 23:25, 1 August 2023 (UTC)
 * ✅ Now all that's left is everybody's favorite part... writing documentation for all of the new templates. *sigh* (Arguably should've been done before they were activated. But, counter-argument: It wasn't.) FeRDNYC (talk) 01:55, 2 August 2023 (UTC)
 * How much smarter would it have been if I'd 'd those examples above, so they weren't invalid now that the sandbox code has been copied to the live template? *sigh* Oh, well. At least I got all of the documentation done. FeRDNYC (talk) 15:56, 2 August 2023 (UTC)
 * ✅ Now all that's left is everybody's favorite part... writing documentation for all of the new templates. *sigh* (Arguably should've been done before they were activated. But, counter-argument: It wasn't.) FeRDNYC (talk) 01:55, 2 August 2023 (UTC)
 * How much smarter would it have been if I'd 'd those examples above, so they weren't invalid now that the sandbox code has been copied to the live template? *sigh* Oh, well. At least I got all of the documentation done. FeRDNYC (talk) 15:56, 2 August 2023 (UTC)