MediaWiki talk:Gadget-HotCat.js
This script, HotCat, is a JavaScript gadget which can be enabled or disabled in your Preferences. The documentation page is located at Help:Gadget-HotCat. |
i18n | Gadget translations:
|
Bug reports and feature requests can be placed here. |
Threads older than 180 days days may be archived. |
Feature request: Ignore square brackets
[edit]If a user enters (e.g. by pasting from the clipboard) [[Category:Foobar]]
, HotCat should understand this as intended to be Foobar
(as it does when the user enters Category:Foobar
). Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:07, 8 February 2024 (UTC)
- Support Marsupium (talk) 01:15, 16 February 2024 (UTC)
- i think the code to change is probably the part from line 991. RZuo (talk) 07:34, 16 February 2024 (UTC)
- This feature is great to insert multiple categories at once via HotCat.
- inserting
England]][[Category:France]][[Category:Belgium
leads to all three categories inserted in one swoop, without needing to go to the confirmation window. --Enyavar (talk) 10:47, 22 June 2024 (UTC)
Support for Timeless Skin
[edit]HotCat doesn't seem to work at all on the Timeless skin. Since it's one of the official skins offered for Wikis, it should be supported. It's annoying when I want to use HotCat and have to switch back to Vector to use it and I don't think it would be that hard to implement. 128.82.20.2 20:59, 5 March 2024 (UTC)
- As a point of information, Timeless isn't an officially-supported skin; Vector 2010, Vector 2022, and Minerva are the only supported skins. Jdforrester (WMF) (talk) 21:15, 5 March 2024 (UTC)
- I'm not sure if you are the maintainer of HotCat (or if there is even such a thing as a maintainer for these types of add-ons), but it might be helpful to add the skin-dependency to the introductory documentation. Also, apologies if that is written somewhere and I missed it. Thank you. Pdanese (talk) 14:49, 17 April 2024 (UTC)
- If you are the administrator of your wiki, you can add a CSS definition to MediaWiki:Gadgets-definition (
* HotCat[ResourceLoader]|HotCat.js|HotCat.css
), which at least makes the hidden #catlinks visible again. This way you can at least work with HotCat. The CSS should be similar to the following:@media screen and (min-width: 1340px){ #catlinks { display: block; } }
. Andreas () 12:32, 3 July 2024 (UTC)
no leading ":"
[edit]Sometimes I mess up copy and paste and the category name is preceded by ":". This leads to Hotcat adding categories like [[:Category::Samples]] instead of Category:Samples (diff) Mediawiki doesn't even render them as categories.
Ideally, HotCat would strip leading ":" from category names directly. Enhancing999 (talk) 08:03, 17 May 2024 (UTC)
"New key" edit summary
[edit]When you add or change a sortkey for a single category using HotCat, this is reflected in the edit summary as new key for Category:X: "N, N". But when you change sortkeys for multiple categories, this results in a category-change type of summary: ±Category:X; ±Category:Y.
It would be neat if the latter case could result in more accurate edit summaries, but this obviously isn't a very pressing matter. Sinigh (talk) 12:48, 1 June 2024 (UTC)
Minor bug report
[edit]Thank you so much for maintaining HotCat. It saves a lot of time when categorizing pages.
I noticed that HotCat tries to re-format the <noinclude></noinclude>
tags it encounters. However, there's a minor glitch: HotCat adds an extra space after the opening tag during said re-formatting. Example edit: en:Special:Diff/1228393712.
Before, all in one line:
}}<noinclude>[[Category:Userboxes|Human]]</noinclude>
After, split over three lines, with placeholder ␣
instead of the space for demonstration purposes:
}}<noinclude>␣
[[Category:Human life user templates|Human]]
</noinclude>
—andrybak (talk) 00:35, 11 June 2024 (UTC)
User Categories with HotCat?
[edit]Is it possible to use user categories with HotCat?
Any advice/guidance, suggestions, or best practices?
--CmdrDan (talk) 20:30, 15 June 2024 (UTC)
- HotCat is agnostic to whether a category is a topic, a user or a technical category, as long as it’s defined directly on the page (not by a transcluded template), so I don’t think any specific guidance or best practices are required – the same applies to HotCat as to adding/changing the category manually. —Tacsipacsi (talk) 13:42, 16 June 2024 (UTC)
- This also includes hidden categories, which can also be added via HotCat. So yes, this is no problem. --Enyavar (talk) 10:54, 22 June 2024 (UTC)
Phabricator ticket T367888
[edit]Hi, after the village pump advised me to go to Phabricator with my bug, a user over there advised me to come here. I don't want to re-write and re-formulate, so please see the full description in ticket T367888: Category options past the top frame of the Commons window are non-clickable.
Thanks. --Enyavar (talk) 10:54, 22 June 2024 (UTC)
HotCat randomly dropping the first addition when adding categories
[edit]On enwiki, HotCat is now sometimes dropping the first category when adding several new categories to a page. I encountered this first at en:ISO-IR-200 when adding the language categories. I don't know if this is related to adding a single new category randomly failing. –LaundryPizza03 (dc̄) 07:16, 14 July 2024 (UTC)
- Can confirm for Commons, but it's not a random "sometimes". To reliably reproduce the bug: It always occurs when you change/add an existing category. Then also add a redirected category. Then don't explicitly confirm the choice by closing the text field and then rely on HotCat to change the redirected category to the correct/real category upon clicking "save" in HotCat. The redirected category does get changed automatically to the correct target, but also all preceding category changes from the same HotCat edit, get removed entirely without further notice. You only find out if you either check the edited page before confirming the edit, or if you check the final result when it is too late.
- You can circumvent this issue if you know how it works mechanically (see above), or you can wait for the HotCat developers to never ever fix the issue (I reported this behaviour two years ago already). I'm doing both right now. --Enyavar (talk) 09:15, 13 August 2024 (UTC)
- I noticed this problem but never found out why it happens. I think often it happened without trying to add an existing category. Also sometimes the edit summary is then empty. Could you please link the issue if you already reported this @Enyavar: ? Maybe it would be good to add examples of cases when it happened there. Prototyperspective (talk) 23:16, 17 August 2024 (UTC)
- Huh, I even did a picture back then. MediaWiki_talk:Gadget-HotCat.js/Archive04#Dropped-categories_bug --Enyavar (talk) 23:21, 17 August 2024 (UTC)
- I thought one could submit bug reports for it on phabricator or a code repository like GitHub. I try to document the next times this bug occurs without trying to add an existing category and then add these examples here in case that helps solving the problem. It's likely a problem with HotCat not MediaWiki/… so it would be nice if somebody could look into it – if one isn't cautious one doesn't notice a category one was trying to add is missing. Prototyperspective (talk) 23:34, 17 August 2024 (UTC)
- Bug reports for HotCat are supposed to be filed here, Phabricator is the wrong place. --Enyavar (talk) 23:48, 17 August 2024 (UTC)
- That's why I wrote that I thought that (until your 23:21 reply). It may be a good idea to put the code onto GitHub/GitLab and not have all the code in one file which may make it easier to change it and track feature requests, bugs, and so on. Maybe somebody interested in developing it further will do so. Maybe one can also request development of this tool elsewhere, like VP/T. Prototyperspective (talk) 09:07, 18 August 2024 (UTC)
- I may collect more cases of this error occurring but these 3 latest ones show that it's not just when trying to add an already existing category (maybe these examples help debug/recreate/identify the cause of the problem):
- tried to add redcat "Horror films videos" and "Monster films" to File:Track of the Moon Beast.ogv but it only added "Monster horror films" and blanked the edit summary (I saved the edit as if for here otherwise I would have pressed page back and redo the very same edit which usually works) see file history
- tried to add cats "Videos of science", "Open access (publishing)", "Category:Videos of librarians", and "Category:Videos in English" to File:Penny Carnaby about open access.webm but it only added the categories except for the first (it didn't blank the edit summary) see file history
- tried to add cats "Milky Way Galaxy with people in front" replacing "Milky Way in art", "People with snow", and "1 people" to File:A climber standing on a snowy slope at night.jpg but it only added the latter two so I pressed back and redid the edit as I intended (see file history) (in this case maybe the file should be in that cat if it's an artificial combination of two images but it's unclear whether that's the case and I just asked about it)
- Prototyperspective (talk) 18:26, 20 August 2024 (UTC)
- At least your first example is exactly what I described: "Monster films" is a category redirect to "Monster horror films", so when HotCat turns the category redirect into the redirected category, the other changes are dropped.
- Not sure how the other examples fit into this, yet, if your added categories are exactly the ones you list. --Enyavar (talk) 18:35, 20 August 2024 (UTC)
- It's not what you described because Horror films videos was not a redirect but a redcat and because Monster films isn't a category that was already set on the file. None of these cats was already set on the file. Prototyperspective (talk) 18:42, 20 August 2024 (UTC)
- It happens more often since a few weeks or so. I think. Somebody please open a proper code issue somewhere (phabricator?). Prototyperspective (talk) 18:14, 7 October 2024 (UTC)
- Hm. I noticed no change, and I did a lot of HotCat categorizing. It happened to me ~twice in the last weeks, and both times as I described (no random occurance but always connected to cat-redirects, but I can't claim there cannot be other circumstances that might cause it for you). That said, I won't complain if someone finally gets this fixed.
- But we already were TOLD on Phabricator, that Phabricator is the wrong place, while this right here is the place to raise and fix the issue. --Enyavar (talk) 18:33, 7 October 2024 (UTC)
- In that case somebody needs to put HotCat into a proper code repository including a proper issue tracker where issues can be tracked in a findable organizable overseeable manner where each issue can be discussed and tracked separately.
Previously HotCat just randomly dropped one category, not it seems to reliably drop the first cat whenever just one of the cats is a redirect. It's a real pain to use it now. One has to think again about which categories one wanted to add to find out which one was dropped and when adding 9 cats at once one may not notice the dropping or it takes a while to remember what the missing cat is. Here I wanted to add Child mortality statistics, Category:Our World in Data correlation and combination datagraphics, Our World in Data graphics about stunted growth and it dropped the first one, it probably doesn't make sense to list many examples here. It seems like something about Wikimedia tech was changed so that HotCat needs a change to be used properly so people don't have to switch to this alternative tool (I prefer HC for several reasons). Prototyperspective (talk) 09:59, 14 October 2024 (UTC)
- In that case somebody needs to put HotCat into a proper code repository including a proper issue tracker where issues can be tracked in a findable organizable overseeable manner where each issue can be discussed and tracked separately.
- It happens more often since a few weeks or so. I think. Somebody please open a proper code issue somewhere (phabricator?). Prototyperspective (talk) 18:14, 7 October 2024 (UTC)
- It's not what you described because Horror films videos was not a redirect but a redcat and because Monster films isn't a category that was already set on the file. None of these cats was already set on the file. Prototyperspective (talk) 18:42, 20 August 2024 (UTC)
- I may collect more cases of this error occurring but these 3 latest ones show that it's not just when trying to add an already existing category (maybe these examples help debug/recreate/identify the cause of the problem):
- That's why I wrote that I thought that (until your 23:21 reply). It may be a good idea to put the code onto GitHub/GitLab and not have all the code in one file which may make it easier to change it and track feature requests, bugs, and so on. Maybe somebody interested in developing it further will do so. Maybe one can also request development of this tool elsewhere, like VP/T. Prototyperspective (talk) 09:07, 18 August 2024 (UTC)
- Bug reports for HotCat are supposed to be filed here, Phabricator is the wrong place. --Enyavar (talk) 23:48, 17 August 2024 (UTC)
- I thought one could submit bug reports for it on phabricator or a code repository like GitHub. I try to document the next times this bug occurs without trying to add an existing category and then add these examples here in case that helps solving the problem. It's likely a problem with HotCat not MediaWiki/… so it would be nice if somebody could look into it – if one isn't cautious one doesn't notice a category one was trying to add is missing. Prototyperspective (talk) 23:34, 17 August 2024 (UTC)
- Huh, I even did a picture back then. MediaWiki_talk:Gadget-HotCat.js/Archive04#Dropped-categories_bug --Enyavar (talk) 23:21, 17 August 2024 (UTC)
- I noticed this problem but never found out why it happens. I think often it happened without trying to add an existing category. Also sometimes the edit summary is then empty. Could you please link the issue if you already reported this @Enyavar: ? Maybe it would be good to add examples of cases when it happened there. Prototyperspective (talk) 23:16, 17 August 2024 (UTC)
HotCat is not automatically removing Category:Media needing categories (Cyrillic names) and its subcategories
[edit]Could HotCat be made to remove them automatically? I encounter a number of files in those categories that are categorized but the person who added categories seemingly just forgot to remove "Category:Media needing categories (Cyrillic names)", so now a second editor has to go through the same files again just to realize that they are already categorized and to remove the maintenance category manually. That is such a waste of time and files are unnecessarily sitting in those maintenance categories for a long time when those categories are already backlogged with all the actually uncategorized files. Automation of the process would be much appreciated. Nakonana (talk) 12:51, 25 August 2024 (UTC)
Bad edit by HotCat
[edit]This edit by User:Elkost was made using HotCats according to automatically added(?) edit description. It moved license section into the middle of {{Location}} template. If that is possible that is a bug we should fix. Jarekt (talk) 14:26, 13 September 2024 (UTC)
- Oh, It's my mistake, thank you! I'll fix it. --Elkost (talk) 14:37, 13 September 2024 (UTC)
- You had fixed it, thanks! --Elkost (talk) 14:45, 13 September 2024 (UTC)
Request: Hiding redirects in the autocompletes if the cat redirected to is also included
[edit]Could it please be made so that when a category is just a redirect to another, it doesn't show the redirect as long as the entered text matches the start of both the redirect and the actual cat? If the redirected to category is included in the autocompletion suggestions, then the redirect should not be shown as well.
For example, when entering "Dixieland" (any text up to that word like Dixiel), it should show only "Category:Dixieland", not also Category:Dixieland jazz. Likewise, it should show only Category:Future rave not also Category:Future Rave or only Category:Midtempo bass music, not also Category:Midtempo bass or only Category:Videos of films from 1990 and not also Category:Videos of films from 1990 in the public domain. Showing both is confusing and leaves people wondering what the correct cat as usually both match. Moreover, as reported in the thread above, selecting the redirect from the autocompletes causes HotCat to drop the first category and not showing these redirects when the actual category is also in the autocompletes anyway would help address this until this problem is solved. Prototyperspective (talk) 18:25, 7 October 2024 (UTC)
Edit summary for sort key removal
[edit]When you remove a sortkey for a single category X using HotCat as indicated in the specific section of the help page, this produce an edit summary that looks like 'new key for Category:X: ""' (in it.wiki 'nuova chiave d'ordine per Categoria:X: "" usando HotCat'). It would be neat if in this case it could result in more accurate and short edit summaries, as maybe 'removed key for Category:X' (in it.wiki 'rimossa chiave d'ordine per Categoria:X usando HotCat') -- ZandDev (talk) 17:39, 31 October 2024 (UTC)