Talk:Adiutor/Archives/2023-09
Switch-case and numeric literals
editHi! I've found numeric literals in switch-case in the Gadget-Adiutor-DEL.js script. It's a bad practice to use numeric constants because they make the code less readable. Please replace them with named constants. D6194c-1cc (talk) 19:07, 2 September 2023 (UTC)
- @D6194c-1cc, The numerical values here are namaspace values, but I will think about it. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 14:21, 3 September 2023 (UTC)
- You can use names from here: mw:Extension_default_namespaces. Take a look at this example: ru:ΠΠΎΠ΄ΡΠ»Ρ:CiteGost (Lua). If more than 1 namespace used in different files, you can create a separate JS file for constants. D6194c-1cc (talk) 14:31, 3 September 2023 (UTC)
- @D6194c-1cc, I think you want me to update current snippet like this right?
- βπ©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 14:48, 3 September 2023 (UTC)
var NS_MAIN = 0; var NS_USER = 2; var NS_USER_TALK = 3; var NS_FILE = 6; var NS_TEMPLATE = 10; var NS_CATEGORY = 14; switch(mwConfig.wgNamespaceNumber) { case NS_MAIN: case NS_FILE: case NS_CATEGORY: case NS_USER: case NS_USER_TALK: case NS_TEMPLATE: selectedNamespace; ...
- Yes, that's what I meant. D6194c-1cc (talk) 14:57, 3 September 2023 (UTC)
- @D6194c-1cc Done commit. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 15:15, 3 September 2023 (UTC)
- Thanks! D6194c-1cc (talk) 17:10, 3 September 2023 (UTC)
- Also, the tr:MediaWiki:Gadget-Adiutor-Loader.js script has numbers instead of names, too. D6194c-1cc (talk) 18:43, 3 September 2023 (UTC)
- @D6194c-1cc Done commit. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 15:15, 3 September 2023 (UTC)
- Yes, that's what I meant. D6194c-1cc (talk) 14:57, 3 September 2023 (UTC)
- You can use names from here: mw:Extension_default_namespaces. Take a look at this example: ru:ΠΠΎΠ΄ΡΠ»Ρ:CiteGost (Lua). If more than 1 namespace used in different files, you can create a separate JS file for constants. D6194c-1cc (talk) 14:31, 3 September 2023 (UTC)
Splitting the tool
edit@π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ: According to the description, your tool provides functions for ordinary users and for privileged users. Consider splitting the tool into two parts according to this criteria. Also ordinary users have no need in scripts for privileged users. D6194c-1cc (talk) 19:14, 2 September 2023 (UTC)
- @D6194c-1cc, Do you mind if can you provide me more details about this please? or you can attach a sample snippet here. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 14:22, 3 September 2023 (UTC)
- Wikipedia communities probably will use your scripts as gadget, so it's reasonable to make two different gadgets for editors/patroller and for admins/other privileged users. Idealistically, it's also for security reasons, because admins might not want to update scripts often and review changes before updating. Small number of scripts are much easier to review. Updates for regular users can be delivered simply by bots. It's also a good practice to have different accounts for editing and for administration, depending on administrator precautions. D6194c-1cc (talk) 19:45, 3 September 2023 (UTC)
- @Vikipolimer: As I see, you've changed the translation system, but still all the scripts are considered as a whole gadget. Do you plan to split the tool into separate independent gadgets (probably with some shared libraries, if needed)? And I'm wander why didn't you do so from the beginning? When the project is divided into independent parts, it's much easier to maintain it. D6194c-1cc (talk) 19:45, 12 September 2023 (UTC)
- @D6194c-1cc, I understand this to mean that a person can choose the modules they want to use, right? Yes, I have such an idea, an editor will be able to choose the modules they want to see or use. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 00:15, 13 September 2023 (UTC)
- That would be great! And also it can easy adaptation of different modules to other wikis. For example, Wikipedia of my language has specific centralised deletion and merge system. D6194c-1cc (talk) 04:11, 13 September 2023 (UTC)
- @D6194c-1cc, I understand this to mean that a person can choose the modules they want to use, right? Yes, I have such an idea, an editor will be able to choose the modules they want to see or use. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 00:15, 13 September 2023 (UTC)
Loading on Vector skin
editHi, just to bring your attention to a JavaScript error I fixed locally on frwiki here. It looks like the line should be removed, but I let you review this, and update the GitHub repository accordingly. Od1n (talk) 22:50, 2 September 2023 (UTC)
- Hello @Od1n, thank you very much for your valuable feedback. The relevant line has been removed and updated in the GitHub repository. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 14:15, 3 September 2023 (UTC)
Code review
editIf you don't mind, I'll try to make a longitudinal (since I have own projects and not much free time) code review. I'll post here advices. Maybe somebody else from the watchers will also want to participate. D6194c-1cc (talk) 19:56, 3 September 2023 (UTC)
In the Gadget-Adiutor-Loader.js switch-case block have a huge piece of code inside it. You can make that switch a boolean function with the name that will explain what do this check do. Contents of the switch can be moved to a separate function, too. Such a moving will reduce indentation and make code more readable. D6194c-1cc (talk) 20:04, 3 September 2023 (UTC)- Otherwise you can make the whole switch a function and return from it in the default block of the switch (the switch will be empty). D6194c-1cc (talk) 20:24, 3 September 2023 (UTC)
- The file was renamed, now it is Gadget-Adiutor-AIL.js and it still has huge nested blocks of code. Hope, this guideline will help to make the code more readable: JavaScript best practicesΒ : Avoid heavy nesting D6194c-1cc (talk) 18:16, 13 September 2023 (UTC)
In the Gadget-Adiutor-Loader.jsswitch(mwConfig.skin) {...}
block can be moved to a function that returns two containers according to the skin. It could look like this:var [container1, container2] = getContainersBySkin(mwConfig); container1.append(adiutorMenu); if (typeof(container2) != "undefined") { container2.append(AdiutorDashboardIcon); } :
As for names, choose them yourself, I don't know what would be the best, because I didn't get deep into the context. D6194c-1cc (talk) 20:19, 3 September 2023 (UTC)
Not working on all skins
editHi. You specify on this page that the tool is supported for 5 skins: Vector, Vector 2022, Monobook, Timeless and Minerva. However, the tool does not appear in the Preferences for the Timeless and Minerva skins. I have tried the other 3 skins and Adiutor can be activated. I have tried it on the French and Turkish Wikipedias.
I have also tried to activate Adiutor using the Vector 2022 skin and choose the Timeless skin again but Adiutor is still not working. It would be great if you could correct this issue so we can try the tool! Regards, Antimuonium (talk) 20:26, 3 September 2023 (UTC)
Video demonstration
editThe developer has its own tasks, so can somebody else make a video demonstration of the scripts and upload it to the commons? OBS Studio might be useful to record the desktop, it's very easy to use. D6194c-1cc (talk) 20:35, 3 September 2023 (UTC)
Participating comminities
edit@Vikipolimer: Just listing all the communities that try to use the tool is not so useful information. Can you provide links to the config and localization files of the communities from the list so that engineers from other wikis might be able to estimate the amount of work that should be done? Also, you've just added Wikimedia Commons, can you explain how do this community involved? As I understand its infrastructure is very different from the Wikipedia projects. D6194c-1cc (talk) 06:24, 4 September 2023 (UTC)
- Hi @D6194c-1cc, this listing is to show how the project is progressing in general, in the future I plan to create a subpage for each local wiki as you said. π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 06:26, 4 September 2023 (UTC)
- What is the practical purpose of such subpages instead of the list? D6194c-1cc (talk) 06:31, 4 September 2023 (UTC)
- Well, I did I myself. @Vikipolimer: As I think you too hurry with forward PR, it might distract some communities. Also, I'd like to give a try your scripts, but I want to do it in my own user namespace. Can you move you scripts as subpages to the Adiutor page so that it would not be dependant on the global namespace? D6194c-1cc (talk) 11:49, 4 September 2023 (UTC)
- I mean using relative paths in the scripts so that they would be dependant only on the parent script. D6194c-1cc (talk) 13:45, 4 September 2023 (UTC)
Request for Wikimedia Commons specific information/documentation
editAs a Administrator and Bureaucrat of Wikimedia Commons, I am concerned that this tool has been rolled out without any Commons-specific documentation. Continually presented as a wonderful tool, but there is no documentation of how to use it - nor any information on what problems in our project it is intended to solve. We have had problems with universal tools in the past that get implemented without consideration of Commons unique environment. The current developers may be unaware of those prior problems. I alluded to this in prior communication which was taken badly by your developer. I would think that caution and cautious questions are a good thing for people on a project as complicated as Commons, but we were chastised for mentioning prior issues. Several Administrators and Bureaucrats questioned the Developer during this process and none received informative answers. It appears on the surface that it was more important to get the name Wikimedia Commons on the meta page than it was to educate, help or assist the Commons users to understand whatever this is supposed to do so they could use it. (Notice the comment above from another user "As I think you too hurry with forward PR") I agree that this feels rushed and I specifically request that Commons specific documentation be prepared on this tool. I am distressed at how Commons users/admins and bureaucrats were treated on our discussion page. My final comment there is at diff https://commons.wikimedia.org/w/index.php?title=Commons:Village_pump&diff=prev&oldid=801195026 the rest of the discussion is before that. Several people asked for more information and received repeats of what is already published on the meta page. If that page was informative - the admins and bureaucrats would not have had those questions which were then brushed off with a repeat of what was already published - and so on. I would request that communication become more cooperative, educational and informative both to and for our users. I additionally request that it not be assumed we do not wish to use your tool - but that the Developer would understand that we need information as Commons is not Wikipedia and our systems are not the same. Most sincerely yours, [Ellin Beltz|https://commons.wikimedia.org/wiki/User:Ellin_Beltz] 06:21, 13 September 2023 (UTC) PS despite being logged into Commons this page refuses to do my signature.
- Hello @Ellin Beltz, this tool is compatible with the current MediaWiki UI as it is coded using MediaWiki JS and OOUI. Additionally, it can be used in a modular fashion, making it easy to add new modules and edit existing ones. This tool can be easily customized by interface administrators, and its code structure is not complex. You can access the documentation through the following links.
- Documentation:
- Adapt_to_local_wiki
- Localization_documentation
- Gadget-Adiutor-AFD.json
- Gadget-Adiutor-AIV.json
- Gadget-Adiutor-CMR.json
- /Gadget-Adiutor-CSD.json
- Gadget-Adiutor-PMR.json
- Gadget-Adiutor-PRD.json
- Gadget-Adiutor-RDR.json
- Gadget-Adiutor-RPP.json
- Gadget-Adiutor-SUM.json
- Gadget-Adiutor-TAG.json
- Gadget-Adiutor-UBM.json
- Gadget-Adiutor-WRN.json
- Documentation:
- π©πΆπΈπΆπ½πΌπΉπΆπΊπ²πΏ β£ 10:26, 13 September 2023 (UTC)
Translation issue with message Wikimedia:Adiutor-rdr-revision-id-help/nl
editIn this message, "identity" surely should be "identifier".