Wikipedia talk:Ultraviolet/2023/March


Nomination for deletion of Template:Uw-defamatory1

 Template:Uw-defamatory1 has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. Someone who's wrong on the internet (talk) 18:54, 10 March 2023 (UTC)

Web Font Abuse Considered Harmful

Currently, Ultraviolet uses the Material Symbols font for its icons. This works by switching to a font which uses "ligatures" to turn certain strings into icons, similar to wingdings. It also makes Ultraviolet completely unusable for people who have downloadable web fonts disabled in their browser; icons display simply as garbled text. Using the SVG or PNG Material Symbols icons instead would avoid this problem. ■ ∃ Madeline ⇔ ∃ Part of me ; 21:00, 3 March 2023 (UTC)

@Maddy from Celeste: Apologies for the late response. The usage of a font to display icons is intentional, as this cuts down on load times, avoids loading in the entire set of symbols repeatedly, reduces redundancy (as support for this method of loading is already available with Toolforge's FontCDN), and is generally easier to implement as it avoids having to deal with <img>. I suggest that you whitelist https://tools-static.wmflabs.org/fontcdn/* if possible (this is a Toolforge reverse-proxy for Google Fonts), or download the font locally to avoid needing to enable downloadable web fonts. Chlod (UV • say hi!) 16:35, 11 March 2023 (UTC)

v0.1.4

v0.1.4 of Ultraviolet has just been released. Release notes can be found here.

This announcement is being made to inform users of a significant change: user configuration is now stored using MediaWiki preferences. Your Ultraviolet settings will be carried over as long as you loaded Ultraviolet using v0.1.4. If you used RedWarn at some point, those settings have not yet been carried over. We advise that you avoid requesting deletion for your redwarnConfig.js page until that happens. An option to re-import those settings will be available in the future.

The per-wiki configuration is now also cached locally on the browser. This will require you to reload pages with Ultraviolet if the per-wiki configuration changes (which rarely happens). Combined, this should lead to a substantial increase in loading times. If you encounter issues due to the update, please contact the team or reply to this thread with the relevant information.

On behalf of the team, Chlod (UV • say hi!) 04:40, 15 March 2023 (UTC)

Bug report

When reporting users to AIV, the interface opens up, but no report is submitted. Upon opening up the interface again, the dialogue "no reason selected" pops up whether a reason was picked or not. Probably an internal coding error IMO. --Roundishtc) 18:59, 14 March 2023 (UTC)

@Roundish: I'm not sure what's the issue here; the report is not automatically submitted by design. Can you tell us the exact steps used to reach this issue? Chlod (UV • say hi!) 22:11, 14 March 2023 (UTC)
wait what. Why not? The ability to report through an interface was very convenient on RW.
Steps:
  1. Attempt to report (have tried right after warning and after reopening/refreshing page)
  2. Select reason "vandalized past 4 warnings"
  3. No report submitted, which is intentional apparently??
  4. When reopening the interface (see brackets on 1.), message shows "no reason selected". That would probably be the main bug at this point.
Roundishtc) 01:13, 15 March 2023 (UTC)
@Roundish: Sorry about that, seems like I misunderstood. I mean reports aren't automatically submitted (that is, click the button and the report is sent immediately). In any case, the report not being submitted when you click on "report" is not intended and this does seem like a bug, but it doesn't seem like there's anything obvious that would cause it. If you could, please copy your Ultraviolet log and send it through whichever means may suit you (additional information is in the link).
As for the second issue you mentioned, the "no reason selected" message is expected since the dialog resets its state when it gets reopened. I'm deciding whether or not to automatically select a reason based on context, but I feel that this may remove the due diligence one performs prior to submitting a report on AIV. Chlod (UV • say hi!) 03:02, 15 March 2023 (UTC)
Emailed you. Roundishtc) 13:10, 15 March 2023 (UTC)
@Roundish: It seems like you didn't make any reports to AIV according to the log. Make sure to copy the log after you've made an AIV report with this issue. Chlod (UV • say hi!) 23:23, 15 March 2023 (UTC)
Oh.
Alright, well I tried with your account (sorry), and I got this in the browser console immediately after trying to report:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'appendContent')
at Report.ts:83:35
at Generator.next (<anonymous>)
at c (tslib.es6.js:73:58)
(anonymous) @ Report.ts:83
c @ tslib.es6.js:73
Promise.then (async)
u @ tslib.es6.js:75
c @ tslib.es6.js:73
Promise.then (async)
u @ tslib.es6.js:75
(anonymous) @ tslib.es6.js:76
l @ tslib.es6.js:72
action @ ultraviolet.js:33
PageIcons.ts:226 Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
at HTMLLIElement.action (https://ultraviolet.toolforge.org/builds/5f49640cc50911b21c13ab766102145cf9f844c6/ultraviolet.js:33:222301)
Upon trying to copy log, this message:
Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'g'
| property 'latestEdit' -> object with constructor 'c'
--- property 'user' closes the circle
at JSON.stringify (<anonymous>)
at <anonymous>:1:11
I'm not any kind of programming expert, but maybe "The string to be encoded contains characters outside of the Latin1 range." could be behind it? Also seems like a bonus bug with not copying the log and all. Roundishtc) 23:58, 15 March 2023 (UTC)
The log failing to copy should have been fixed with v0.1.4, so that's definitely odd. But the error that you copied from the log definitely does help. Checking this out now... Chlod (UV • say hi!) 00:00, 16 March 2023 (UTC)
@Roundish: I've pinpointed the issue down to a recent MediaWiki change that affected the parser. The relevant bug can be found at phab:T332243. For now, I'll be making an emergency change to Ultraviolet to handle this case. Apologies for the disruption. Chlod (UV • say hi!) 01:22, 16 March 2023 (UTC)
@Roundish: This problem should be fixed for now with this change. I'll add additional safeguards to prevent this from happening in the future. Chlod (UV • say hi!) 01:36, 16 March 2023 (UTC)

Moving preferences to Special:BlankPage/UVPreferences

I would suggest moving the preferences for UltraViolet to this "blank page". The reason for this is to make sure that a user does not end up on a non-existent page when accessing the preferences. The links would always appear blue when UV is put on other wikis, and it will also become evident if there is a problem with loading UltraViolet preferences. Lastly, it will also help combat vandalism-related issues across wikis since special pages cannot simply be "edited". Aasim - Herrscher of Wikis ❄️ 02:27, 16 March 2023 (UTC)

Wikipedia:Ultraviolet/Preferences telling you that UV is still loading/not loading is definitely more informative than "This page is intentionally left blank." Red-link issue can be solved by Ultraviolet manually overriding either that or some other page title to turn blue. Vandalism related issue doesn't really matter since anything unsavory is immediately wiped by UV once the interface loads. In any case, the plan is to not have the preferences use an on-wiki page completely, so this will essentially be moot down the line. Chlod (UV • say hi!) 02:34, 16 March 2023 (UTC)
You can use CSS to display content on a page before JS loads, i.e.
.page-Special_BlankPage_UVPreferences #firstHeading {
	visibility: hidden;
}

.page-Special_BlankPage_UVPreferences #firstHeading:after {
	content:'Loading...'; 
	visibility: visible;
}
Ed talk!20:47, 19 March 2023 (UTC)
Script CSS is only applied once the script loads. The entire time from first paint to when the userscript loads, this CSS will not be applied, and the text is still visible. This is no different from changing the text with JS. Not even saving this in common.css will prevent a FOUC. Chlod (UV • say hi!) 06:29, 20 March 2023 (UTC)
I think should use BlankPage, it makes sense for internationalization later. Plantaest (talk) 19:21, 16 March 2023 (UTC)
Like I said, the goal is to not use an on-wiki page at all. Chlod (UV • say hi!) 06:29, 20 March 2023 (UTC)

Double warnings on failed rollback

When you rollback an edit and there are new revisions, UV sends an error message that the current revision changed. However, if you use 'true' rollback, it also sends a generic error message that the rollback failed on top of it, resulting in the previous not being readable. Snowmanonahoe (talk) 15:05, 23 March 2023 (UTC)

@Snowmanonahoe: Taking a look at this right now. Chlod (UV • say hi!) 23:16, 29 March 2023 (UTC)
I've finished up work on this, but I'm holding back on deploying it until I get the above tested as well. Chlod (UV • say hi!) 23:48, 29 March 2023 (UTC)
  Done. Chlod (UV • say hi!) 00:42, 30 March 2023 (UTC)

Checkboxes display incorrectly in Wikipedia:Ultraviolet/Preferences

I think checkboxes in Wikipedia:Ultraviolet/Preferences should display like this: https://m3.material.io/components/checkbox/overview. Currently, I don't see "tick" icon of these checkboxes. Plantaest (talk) 08:44, 17 March 2023 (UTC)

@Plantaest: This has been a persistent issue that we're still unsure what causes the issue. The checkboxes are implemented exactly as they are described in developer documentation, but they still appears incorrectly nonetheless. I'll dedicate more time to this when I'm not working on other features. Chlod (UV • say hi!) 06:32, 20 March 2023 (UTC)
@Chlod: I think I can help to investigate this problem on someday. Plantaest (talk) 13:23, 20 March 2023 (UTC)
@Chlod: Hi Chlod, you should add stroke="white" to this line: https://gitlab.com/redwarn/ultraviolet/-/blob/dev/src/styles/material/ui/components/MaterialCheckbox.tsx#L51. Plantaest (talk) 14:21, 20 March 2023 (UTC)
@Plantaest: stroke="white" and stroke="#ffffff" unfortunately didn't work. Chlod (UV • say hi!) 14:51, 20 March 2023 (UTC)
@Chlod: You can go to Wikipedia:Ultraviolet/Preferences, and use F12 (Elements tab) > [Edit as HTML] to test this SVG element with stroke="white" attribute. When I inspect the example on the original docs, I have seen they use stroke="white", and your code don't have this attribute in SVG tag. Plantaest (talk) 15:16, 20 March 2023 (UTC)
@Plantaest: stroke="white" is used on the <path>, not on the <svg> element. Placing a stroke attribute on either does not work. The example you linked to is already a near-exact copy of what exists on the code right now, besides minor additions. Even with the stroke attribute added, the check marks still do not appear. If you would like, you can test this change locally to see if it works. Chlod (UV • say hi!) 16:04, 20 March 2023 (UTC)
@Chlod: The problem is that SVG cannot be rendered by tsx-dom; need to use some tricks to solve this problem. At the end of MaterialCheckbox.tsx file, you add below function:
function createCheckboxSvg(id: string) {
    const xmlns = "http://www.w3.org/2000/svg";

    const svgElem = document.createElementNS(xmlns, "svg");
    svgElem.setAttributeNS(null, "class", "mdc-checkbox__checkmark");
    svgElem.setAttributeNS(null, "viewBox", "0 0 24 24");

    const pathElem = document.createElementNS(xmlns, "path");
    svgElem.append(pathElem);
    pathElem.setAttributeNS(null, "class", "mdc-checkbox__checkmark-path");
    pathElem.setAttributeNS(null, "fill", "none");
    pathElem.setAttributeNS(null, "stroke", "white");
    pathElem.setAttributeNS(null, "d", "M1.73,12.91 8.1,19.28 22.79,4.59");

    const svgContainer = document.getElementById(id).nextElementSibling;
    svgContainer.prepend(svgElem);
}
and use it after the line of component.initialSyncWithDOM(); like this:
    setTimeout(() => {
        component.initialize();
        component.initialSyncWithDOM();
        createCheckboxSvg(id);
    }, 0);
See more:
Plantaest (talk) 09:46, 21 March 2023 (UTC)
@Plantaest: Sorry for the delayed response! I'll try this out and get back to you eventually. Chlod (UV • say hi!) 23:12, 29 March 2023 (UTC)
@Plantaest: This still doesn't seem to work, or perhaps my implementation of this might be flawed. If you've verified that this works, maybe create a merge request on GitLab (you'll need a Wikimedia Developer Account) or send a Git patch file over? Chlod (UV • say hi!) 00:15, 30 March 2023 (UTC)
@Chlod: No problem. I'm not familiar with GitLab and Wikimedia Developer Account, so I will not continue to fix this problem. The key is that tsx-dom uses document.createElement, not document.createElementNS, so it cannot render svg, and your tick icons in checkboxes will disappear. P/S: Maybe you should try clearing the cache? Plantaest (talk) 03:21, 30 March 2023 (UTC)
@Plantaest: I've   fixed the issue. You were correct that it was tsx-dom, however the issue specifically occurs on tsx-dom@1.3.0 and not tsx-dom@1.4.0. I've been holding back on switching to 1.4.0 due to type conflicts that I wanted to resolve at a future date, but knowing that this was the likely cause of the issue, I decided to perform that refactoring today. Chlod (UV • say hi!) 09:15, 30 March 2023 (UTC)

Feature Request: Multiple Contribution Tagging for Disruption

Hello! I am requesting a feature for multiple issue tagging in warn templates.

Current behavior: There is a "Related Page" dropdown in which you can select a page to be referenced in the tempate.

Feature requested behavior: In-line list of recent contributions of the user, with checkboxes that may be multi-selected. Even if the warn template only supports a single page to be referenced, I think it will be useful if RW/UV can generate a bulleted list of the offending contributions.

Motivation: Say that someone is being warned for disruptive editing. Later, they continue to disruptively edit. First scenario: The user has made several disruptive edits, though their other edits are fine. A multi-select will inform the user easily as to which edits were problematic. Second scenario: Another user wishing to re-warn or report the offending user to ANI should be easily able to see the list of contributions which were previously multi-flagged in the past, rather than themselves having to search through a user's revert history (and not all reverts may have been the causes of previous warnings). Top5a (talk) 11:30, 29 March 2023 (UTC)

@Top5a: This is a good feature, but its implementation would be limited due to the way warning templates are currently formatted on this wiki. The most we'd be able to do is save whatever revisions were recently made so that it can be "suggested" when writing an AIV report, but including them in the warnings themselves might need more investigation/community discussion. Chlod (UV • say hi!) 23:21, 29 March 2023 (UTC)
Hi! Thanks for the reply! Well, I know that the templates can only ingest a single reference, so my suggestion is that the template can optionally be used with zero reference ingestion, but then a bulleted list of referenced posts can be appended to the warn template. For example, custom data.extraInfo is already appended after the template. So, a user of RW/UV can either elect to utilize the current method of singular reference ingestion in the template, or select from multiple problematic edits which will be appended to the template in the same manner as data.extraInfo is. Top5a (talk) 00:25, 30 March 2023 (UTC)
@Top5a, it might be worth modifying the warning templates first. — Qwerfjkltalk 09:19, 30 March 2023 (UTC)

Dialog popups not opening

Recently, any of the UV buttons that cause a popup message box i.e. all of them except the "latest revision" and "alert on change" buttons have stopped working - clicking them causes nothing except an animation. Just tried UV today for the first time in a while and found this bug. — Qwerfjkltalk 10:53, 30 March 2023 (UTC)

Likely regression in the code pushed earlier. Checking this out now. Chlod (UV • say hi!) 10:54, 30 March 2023 (UTC)
Almost done; just finishing some final checks. Chlod (UV • say hi!) 11:29, 30 March 2023 (UTC)
@Qwerfjkl:   Fixed. Apologies for the inconvenience. Chlod (UV • say hi!) 11:34, 30 March 2023 (UTC)