MediaWiki talk:Gadget-HotCat.js

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


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)[reply]

 Support Marsupium (talk) 01:15, 16 February 2024 (UTC)[reply]
i think the code to change is probably the part from line 991. RZuo (talk) 07:34, 16 February 2024 (UTC)[reply]
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)[reply]

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)[reply]

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)[reply]
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)[reply]
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)[reply]

Keyboard shortcut (accessKey) for "Save" button?

[edit]

Hi, when using HotCat heavily, it's a little bit fiddly to switch between mouse and keyboard. This is required when you've to use the "Save" button. Thus, it would be great if that button would have an accessKey property assigned (maybe this is possible client-side, but i don't know how...). TIA! Fl.schmitt (talk) 11:49, 29 March 2024 (UTC)[reply]

Could a warning popup appear when adding a DAB cat while using HotCat?

[edit]

The problem: If you try to add a Disambiguation category (DAB category) to a file or category using HotCat, you cannot see that it is a DAB category. It is undesirable to have files or categories in DAB categories. So a lot of DAB categories have files and/or subcategories, see Category:Non-empty disambiguation categories (not only due to HotCat). This problem is being discussed on Commons:Village pump#How to make a structural solution for not empty disambigious pages?, issue 2.

Possible solution: If you try to add a DAB cat via the edit tab, a warning pop-up appears. Could such a warning pop-up also appear when you try to add a DAB cat via HotCat? JopkeB (talk) 04:55, 20 October 2022 (UTC)[reply]

Yes, it’s technically possible. The question is only whether there will be someone who implements it. 🙂 —Tacsipacsi (talk) 22:11, 20 October 2022 (UTC)[reply]
How can we reach people who might implement this request? JopkeB (talk) 04:27, 21 October 2022 (UTC)[reply]

I have made a proposal on the Wishlist 2023, see meta:Community Wishlist Survey 2023/Multimedia and Commons#A warning popup when adding a DAB cat while using HotCat. --JopkeB (talk) 05:25, 25 January 2023 (UTC)[reply]

we actually dont need a warning.--RZuo (talk) 19:55, 20 March 2023 (UTC)[reply]
RZuo: Why do we not need a warning? It happens to me regularly that I add unintentionally a DAB category using HotCat, and many more editors do so. I would like to prevent that from happening. --JopkeB (talk) 05:28, 21 March 2023 (UTC)[reply]
It is requested that an edit or modification be made to this protected page.
Administrators: Please apply <nowiki> or {{Tl}} to the tag after the request is fulfilled.

Nakonana

change line 87 to disambig_category: 'Disambiguation categories',
because some jokers did these without announcing them to the whole commons community https://commons.wikimedia.org/w/index.php?title=Template:Disambig&diff=prev&oldid=582141057 https://commons.wikimedia.org/w/index.php?diff=582136498 . RZuo (talk) 19:55, 20 March 2023 (UTC)[reply]
@Jon (WMF) could you please help with changing line 87? thx! RZuo (talk) 08:12, 21 May 2023 (UTC)[reply]
I’ll try to summarize the status of this edit request as I understand it:
  • HotCat has a feature to warn when adding categories that are marked as disambiguation categories.
  • The feature, I assume, used to work as intended (and as requested above) on Commons.
  • Later, Category:Disambiguation categories was split off from Category:Disambiguation on Commons, which broke the feature.
  • For a while, nobody realized this had happened.
  • People started to realize again that this would be a useful feature to have; this edit request was made, and eventually even added to the community wishlist survey, without (apparently?) anybody realizing (or at least mentioning) that the feature already existed and used to work.
  • Either Category:Disambiguation categories needs to be merged back into Category:Disambiguation on Commons, or HotCat needs to use Category:Disambiguation categories rather than Category:Disambiguation as the marker category on Commons.
“On Commons” is a key phrase in that last bullet point – I assume that we should not change this on other wikis. But I don’t understand the HotCat config system well enough to judge whether the edit suggested by RZuo would have that effect or not; therefore, I won’t be applying this edit request at this time. But I hope that this clarification enables some other interface admin more familiar with HotCat to fix the situation. Lucas Werkmeister (talk) 20:54, 5 November 2023 (UTC)[reply]
@Lucas Werkmeister they always have localised settings "on other wikis", because except enwp all others dont write in english. for example, Category:Disambiguation pages (Q1982926).
line 42 Localize these messages to the main language of your wiki.
lines 83-85 are the instructions for disambig_category.
disambig_category is used only in lines 991 and 997. i assume that's the part of the dab functionality. RZuo (talk) 21:04, 5 November 2023 (UTC)[reply]
(Resurrected from the archive because we really shouldn’t have archive pages in the edit request category. I’ll try to look into this later and see if the edit request can be fulfilled or not.) --Lucas Werkmeister (talk) 19:41, 9 May 2024 (UTC)[reply]

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)[reply]

"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)[reply]

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)[reply]

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)[reply]

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)[reply]
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)[reply]

Phabricator ticket T367888

[edit]
the bug in one image

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)[reply]

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 (d) 07:16, 14 July 2024 (UTC)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]
Bug reports for HotCat are supposed to be filed here, Phabricator is the wrong place. --Enyavar (talk) 23:48, 17 August 2024 (UTC)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]

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)[reply]