Module talk:Catnav

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Module not working properly any more

[edit]

Dear Verdy p, whatever you are trying to fix (probably some minor issues), please use the sandbox first to make sure you don't break other things which were working properly until now and looked allright. The optical result after your recent changes is awful. The shortened box looks terrible and you mixed up lines, at least in combination with the flag at the right. Please take care of all details, even the ones that worked until now. Please look at terrible results such as Category:Dresden photographs taken on 2022-09-28 and Category:February 2022 Dresden photographs (two cities in two lines for no good reason) and fix it within the module, thank you! Or even better: Restore how it was before your doubtful changes (experiments ?). Please use the sandbox until you are sure that you don't break things while working on others. I don't mind if you truely improve details, but please make sure every thing else stays fine. Thank you in advance. --Kleeblatt187 (talk) 19:51, 9 December 2022 (UTC)[reply]

There's no issue at all that breaks anything. On the opposite the forced clearnig that was present causes a problem with other contents, notably infoboxes, causing the whole rest of the page being left blank in categories, so that we need to scroll down. There's no thing "awful" at all. I took care of all details and tested on many pages without seeing an effect.
That box is used in very few pages in German, contradicts all other navboxes; that module is extremely badly written, very difficult to maintain, with "cryptic" varaibles everywhere and no comment, plus lot of "magic" that are very hard to set (plus still incorrect CSS layout and composition; in addition it is extremely wasteful of server resources. That module for most part has NEVER been discussed anywhere, "'developped" with many uncommented changes by an anonymous user (makeing many successive errors that he fixed frequently. He did not develop any sandbox and test. And as far as I see it is mostly used for German states only, with various options that are not even used (and causing usability problems, like navigating by icons only, and incorrect resolution of redirects and know aliases. I have still not removed any "details" functionally.
If for the two examples you give this is incorerct, this is simply because the CSS that was in the original code is incorrect (it uses two "table rows" outside of any table!), using quirks that I want to fix to make it much more standard.
The immediate fixes I made did not need any sandbox, as there was no major change (and there's absolteuyly never been any sandbox or discussion, contrary to what the current doc affirms). The only sandbox is the one I created myself (but it is not usable in real time because of the way it is invoked and there's no logic for now to support any "testbed" in a few sample categories; for this reason there was absolutely no example working in a sample).
Note that the box width itself is NOT the problem. But this is the general unstructured layout of blocks that cannot work as is (it was working by trying to use "nowrap" for the whole row, but this cannot work reliably).
But the error remains and cannot be fixed without restructuring (and solving the *damned* problem caused by the uncommented code using cryptic variables and magic. verdy_p (talk) 21:18, 9 December 2022 (UTC)[reply]
I don't understand any of the Lua code, I just believe what you say. And I want to assume your good faith as well. Nevertheless I can see some negative effects of your recent edits, please see above. Would you please fix them as well? At this time I cannot find the place where to do so. If you say it's not within this module, then I guess it should be fixed within Template:Districts of Saxony then, which depends on Module:Catnav. Thank you in advance! --Kleeblatt187 (talk) 22:03, 9 December 2022 (UTC)[reply]
The module has worked for years reliably. If people complain about recent changes, then the recent changes are faulty and not the module. --84.135.112.144 19:51, 10 December 2022 (UTC)[reply]
If people break stuff intentionally and then claim its broken, that's not the module's fault. --84.135.112.144 19:54, 10 December 2022 (UTC)[reply]
The 'errors' as verdy has put it have been successive feature improvements. There wasn't a single time (or very limited so) that the output of the module has been broken. Claims on wasting server resources are especially true if unexperienced people change the live code and force the server into updating lots and lots of page caches (!). As the lua code is compiled server side and the dependencies are rather small (compare the wikidata stuff and the wikidata infobox; they have been imported, waste tremendous amounts of cpu cycles, and noone has ever complained about server resources wrt that), the server load is exceptionally small, if not neglectable. --84.135.112.144 20:22, 10 December 2022 (UTC)[reply]
Thanks for clarification! By the way, as of now more than 176000 templates and category pages depend on this module, a lot of them referring to Germany. --Kleeblatt187 (talk) 20:47, 10 December 2022 (UTC)[reply]
I see but they are based only on a few templates, and I'm working on fixing the CSS issue that is still there (notably the box content model which is wrong since the beginning, but tere are still other CSS issues, and fixing that requires some progressive transformation and clarification of the cryptic code made by a few anonymous users that did not discuss anything anywhere and made their own errors they fixed multiple times by making things even more tricky). As such the code is hard to fix except the initial container box (the inner boxes uses a very strange code that does not work even the way it is described in the doc). This will take time to transform things into somethnig maintainable. there's only one serious problem for now: the extra linebreak that occurs in the middle of a row instead of extending the width. That code attempt to mimic a table but not the correct way, as this interacts badly with a float used by the left icon, which is not properly contained in the simulated table (this generates what is know as a "undefined behavior"; CSS should never be used liek this; as well the fact the codes uses self-mutating fonctions does not help; and yes thre are issues with how Lua tables are used, in adition to problems with some string patterns that are not strict enough, internal conditions are then self-contradicting in various cases).
However the claim that I "broke" something is false, even in Germany-related categories.: every thing is there, nothnig is missnig, jsut some incorrect layout, and incorrect accessibility, depending on screen size (I have still not changed that last issue). What I'm doing is first clarifying the code to better see the dependencies between the internal variables and states. I have not make radical changes for now, I have tested many things (but there was no test at all before, so don't claim that must make changes that did not even exist from the original anonymous authors). verdy_p (talk) 21:03, 10 December 2022 (UTC)[reply]
Noone wanted to keep you from playing with that code to see if it can get better. The serious point Kleeblatt made is that one should have created a testbed/separate version for thorough testing - and only after being sure everything is straightened out (including the hard to spot cornercases) an attempt to overwrite and/or 'fix' what was found should have been made, i.e. the point started from. The layout is a serious part of the output generated by this module and if users of the pages have grown accustomed to a specific way navigation is rendered on the pages relying on this module in the background. If you change the layout in a way that it breaks that grown expectation, then of course you 'broke' something. Would you trust an atm that reorderd all the numbers for your pin code? Most people would not, even if the person that did the change claims that he didn't break anything, because, well, all the numbers for input are still there.. --84.135.112.116 23:08, 26 December 2022 (UTC)[reply]
[1] deliberately breaks user's css settings to style specific Catnav instances. Also, it does not strip Template_ as advertised but simply the first 10 characters. If the modules is used from a different namespace, or invoked from main namespace, this does not only break previous behavior users have relied upon, it also generates weird/false/cut-at-random css class name for an instance in question. This example of breakage, among others, is just an example further looked into..
The only benefit seems to be the isRTL caching and to use that, a whole lot of useless changes and css breakage, let alone the rant about the box model, has not been necessary at all. The changeset to the original code could have been much smaller and less error-prone by just importing that. --91.55.169.14 11:34, 27 December 2022 (UTC)[reply]

Prepend colon to prefix Category:

[edit]

i'm trying to make it do:

if prefix is "Category:..." then

prefix = ":Category:..."

but i dont know how. Module:Countries does that. this module should do the same. RZuo (talk) 08:53, 23 February 2023 (UTC)[reply]