User talk:CalendulaAsteraceae/Archive 5

Module:PD
Hi,

Thanks for all your work on consolidating and Lua-fying all the license templates! It's been on my todo list for ages so I'm very happy to see progress being made here.

But some unsolicited advice / general musings without having looked closely at the code… As a rule of thumb type thing, I get a bit worried when so many different things are being consolidated into a single module. That tends, in general, to lead to unwieldy and complicate code, which in turn tends to be fragile or hard to maintain code. Despite the obvious similarities, there are many different logics at work in the different PD templates, which may be best handled in related-but-separate modules (or it may not). Similarly, it's usually sound practice to separate concerns: put completely generic logic in a lower-level "infrastructure" module used by the core business logic; and farm the layout and text strings out to a template so it can be edited independently of the core business logic.

You may already be well aware of such rules of thumb, and they may not be relevant in the current case, but I figured I'd mention it just in case it's useful. Feel free to ignore me or tell me to go suck eggs if it's not. :-) Xover (talk) 09:51, 4 October 2022 (UTC)


 * That is in fact new and relevant advice for me, so thank you :-) I'll think about what makes sense in this case. —CalendulaAsteraceae (talk • contribs) 23:53, 5 October 2022 (UTC)
 * @Xover: Speaking of Lua-fying things, could I ask you to take a look at Module:Do not move to Commons and Do not move to Commons/sandbox? Something is clearly not working here but I'm not sure what. —CalendulaAsteraceae (talk • contribs) 04:53, 8 October 2022 (UTC)
 * This is what we usually refer to as a "braino". :) Xover (talk) 10:53, 8 October 2022 (UTC)
 * @Xover Well, I'm glad I asked! Do you know why when I reload Sandbox the images briefly show up and then disappear? —CalendulaAsteraceae (talk • contribs) 16:18, 8 October 2022 (UTC)
 * @CalendulaAsteraceae: Hmm. That looks like a new and exciting bug in dynamic layouts. Though I don't immediately see what's going on there. If you need to debug without interference you can just turn off the dynamic layouts in your Gadgets preferences for now. Xover (talk) 16:27, 8 October 2022 (UTC)
 * @Xover: Cool, thanks :) I'd be hesitant to migrate Do not move to Commons to the module while this bug is in play; is there somewhere I should report it? —CalendulaAsteraceae (talk • contribs) 02:47, 9 October 2022 (UTC)
 * Well, is the one responsible for its current state of "pretty darn decent, actually"; but as they're rather busy IRL these days I was planning to have a look myself as soon as I can find the spare cycles. No promises on when that'll be, or how long it'll take. As mentioned, I observe that the problem goes away when I disable the dynamic layouts, but I have no idea why the dynamic layouts would lead to this problem. Figuring out what's going on may take quite a bit of digging (or it may not). Xover (talk) 08:05, 9 October 2022 (UTC)
 * Makes sense, and thank you! —CalendulaAsteraceae (talk • contribs) 00:25, 10 October 2022 (UTC)
 * Just to update the status: I think I've found the cause for this, but I'm not sure I fully understand all the mechanisms playing into it, and I still don't know how we're going to fix it. The short-short version is that the specific style rules used for the message box, when combined with a too narrow container width, ends up leaving no horizontal space for the images to display in. They're there, but 0px wide. It probably only happens with dynamic layouts (not all narrow windows) because it changes the container width after the web browser has calculated the table's dimensions and is for some reason not triggering the browser to relayout. On investigation it looks to be related to a similar problem with a different template (which I'd been banging my head against, so this might finally help solve that too).But, in the short term, Do not move to Commons is only for use on file description pages, and dynamic layouts are not active there (they're just active on sandboxes to enable testing), so you should be good to go with that template. Other message box based templates for use in mainspace or elsewhere dynamic layouts are active are more iffy. Xover (talk) 09:47, 16 October 2022 (UTC)
 * @Xover: Thanks for the update! —CalendulaAsteraceae (talk • contribs) 20:48, 16 October 2022 (UTC)
 * Ok, I've found and, hopefully, fixed the issue.The dynamic layouts were setting a hard  on all   elements in order to prevent actual images in texts from overflowing their available space. But the message box code sizes its image components relative to available space, so the images ended up 100% of 0px wide. To override it we need to set   on the images inside the template, but since dynamic layouts used ID selectors (which always beat out class selectors) this had no effect. To remedy this I've altered the dynamic layouts gadget to use class instead of ID selectors.Testing has been limited so there may still turn up something that invalidates this fix, but modulo that this issue should be fixed now. Xover (talk) 16:21, 24 October 2022 (UTC)
 * @Xover: Thank you for the explanation! Do not move to Commons seems to be working everywhere now. Missing image, however, still seems to be having problems. See e.g. Cassini Shows Grandeur of Two Saturn Moons. —CalendulaAsteraceae (talk • contribs) 02:15, 26 October 2022 (UTC)
 * Fixed. Thanks. Xover (talk) 05:01, 26 October 2022 (UTC)
 * @Xover: did a more thorough check, looks like tmbox, mbox, fmbox, ombox and cmbox need a similar fix. (Imbox, pmbox and ambox are OK AFAICT.) Thank you for working on this! —CalendulaAsteraceae (talk • contribs) 05:28, 26 October 2022 (UTC)
 * tmbox is for talk pages; fmbox is for edit notices; cmbox for categories. ombox is for "other" pages, typically Wikisource:, Help:, etc. Neither of these will coexist with dynamic layouts. mbox is for multi-namespace boxes, and calls one of the others dynamically, inheriting their properties. imbox doesn't strictly need the fix either, since it's for File: pages where dynamic layouts aren't active. It's ambox (mainspace notices) and pmbox (Page: namespace, but get transcluded to mainspace) that actually need it, and those should be good now. Xover (talk) 05:57, 26 October 2022 (UTC)
 * @Xover, thanks for the explanation and the fix! —CalendulaAsteraceae (talk • contribs) 01:03, 27 October 2022 (UTC)

plainlist and hanging indent
Hi. I removed (migrated) all the current uses of indented plainlist because plainlist has a hi that does effectively the same. Would you mind if I G7 speedy indented plainlist? It's blocking some other maintenance, and having to keep the two variant implementations in sync is going to be a real pain long term. Xover (talk) 12:10, 27 November 2022 (UTC)


 * @Xover go ahead. I appreciate that you're working on this kind of issue :) —CalendulaAsteraceae (talk • contribs) 16:06, 27 November 2022 (UTC)

Template:Saferoman
What did you change that's causing the item for 4000 to generate a spurious message of "No mode given"? Thanks. ShakespeareFan00 (talk) 08:36, 17 February 2023 (UTC)

This really needs a check for a zero value? (as does Module:Roman). ShakespeareFan00 (talk) 11:50, 17 February 2023 (UTC)
 * @ShakespeareFan00 All I changed in saferoman was to actually put usage examples in the documentation. Could you elaborate on what you mean by a check for a zero value? —CalendulaAsteraceae (talk • contribs) 05:44, 18 February 2023 (UTC)
 * From reading wikipedia, N or nullis was sometimes used as a zero symbol for roman numerals, albiet in works after the classical period. - https://en.wikipedia.org/wiki/Roman_numerals#Zero
 * ShakespeareFan00 (talk) 22:42, 18 February 2023 (UTC)
 * Interesting point, thank you! —CalendulaAsteraceae (talk • contribs) 23:10, 18 February 2023 (UTC)
 * @ roman and saferoman currently do not generate an error if "0" or a negative value is entered, instead failing silently (saferoman), or outputting "No mode given". (roman). I would also suggest carefully checking what the output values of a given conversion function are when comparisons are made (this proved to be an issue with one of the RVH templates that calls the relevant modules. (BTW roman and saferoman should be in the same module I think. ShakespeareFan00 (talk) 09:04, 18 February 2023 (UTC)
 * My suggestions is that if Module:roman or Module:Saferoman encounters an invalid value it inserts a tracking category for the Page: it's invoked from, as it's almost certainly a fixable proofreading error.
 * ShakespeareFan00 (talk) 09:05, 18 February 2023 (UTC)
 * Agree that Module:Roman and Module:Saferoman should be the same module. I also think that the way I added Arabic-to-Roman functionality to Module:Roman, and the way it goes through the same function as Roman-to-Arabic functionality, isn't the best. I'll see about retooling that. —CalendulaAsteraceae (talk • contribs) 23:12, 18 February 2023 (UTC)
 * @ShakespeareFan00 I've added an updated version of  to Module:Roman, and made saferoman use it. I'll work on a tracking category next. Also, do you have suggestions for how saferoman should handle numbers above 1,000,000,000? Right now,  produces a string of 1000 M s, which doesn't seem very safe. —CalendulaAsteraceae (talk • contribs) 00:52, 19 February 2023 (UTC)
 * Category:Errors reported by Module Roman —CalendulaAsteraceae (talk • contribs) 00:52, 19 February 2023 (UTC)
 * Hmm..
 * https://en.wikipedia.org/wiki/Roman_numerals#Large_numbers there are various approaches.. What to use depends on what's in the sort of texts being transcribed. ShakespeareFan00 (talk) 14:41, 20 February 2023 (UTC)
 * Saferoman was using the Vinculum method, but it wasn't necessarily fully implemented for really big numbers. ShakespeareFan00 (talk) 14:41, 20 February 2023 (UTC)
 * After thinking about it for a bit, I think the failure case for is basically a case of "play stupid games, win stupid prizes". I'll put a warning in the documentation, and revisit the issue if there turns out to be a need to transcribe larger Roman numerals using the template. —CalendulaAsteraceae (talk • contribs) 04:29, 22 February 2023 (UTC)

Recto-verso
Hello. I'd suggest to move the roman page number processing functionality from rvh2 to rv so it could be used by other recto-verso templates. It would also make the template rvh gain the same functionality as rvh2 so the latter could be replaced with the redirect to the former. -- N o n e x y st d 14:07, 20 February 2023 (UTC)


 * @Nonexyst, great idea; thanks for suggesting it! —CalendulaAsteraceae (talk • contribs) 22:25, 20 February 2023 (UTC)

Full screen width TOC is not needed
We are reproducing content, not the exact look. The full screen width that gets pushed with the TOC series of templates is awkward to read. The table method I've been using for 10 years, or so, is much better looking for the end reader—and gets away from the printers' tricks of dotted leaders. I don't see any need to modify them away from the simple way I've done them. Beeswaxcandle (talk) 03:37, 25 February 2023 (UTC)


 * Legit, sorry! —CalendulaAsteraceae (talk • contribs) 03:41, 25 February 2023 (UTC)