Module talk:EditAtWikidata

Edit request June 2019
There is a request here to use a different icon for the pencil (optionally). The default icon File:Blue pencil.svg when next to an external link visually bleeds into the hyperlink since they use the same shading. For example see the infobox at Anglican Communion ("Official URL"). (This is using ). The suggestion is to change the icon to the one used in the interwiki language box on the left side of the screen (same size/shape pencil just solid). I can't determine which icon image it is, but probably one in this category. I think a new argument to specify the image file (optionally, defaulting to current) would do the trick. . -- Green  C  14:32, 18 June 2019 (UTC)
 * - can you provide any insight that could help with this UI element? I'd like to keep things as consistent across the page as possible. — xaosflux  Talk 14:56, 18 June 2019 (UTC)
 * it looks like from the delivered page source that one is coming directly as raw svg data for the browser to render. — xaosflux  Talk 16:31, 18 June 2019 (UTC)
 * Thanks for pinging, I'd recommend File:OOjs_UI_icon_edit-ltr-progressive.svg for this, as it would use the standard edit icon. I'd also not be concerned with the slight color difference as it's only on a 16x16px base and the link colors are discussed to be changed to this new standard, accessible color as well in T213778. – Volker E. (WMF) (talk) 03:32, 19 June 2019 (UTC)


 * pending feedback. — xaosflux  Talk 14:57, 18 June 2019 (UTC)
 * — xaosflux  Talk 13:14, 19 June 2019 (UTC)
 * ✅ — xaosflux  Talk 13:17, 19 June 2019 (UTC)

Wikidata Bridge
(Reposted from Module talk:WikidataIB § Wikidata Bridge.)

I'm guessing that the module maintainers might be unaware of this? The WMDE developers have been working on mw:Wikidata Bridge, which will allow some Wikidata statements to be edited directly through infoboxes and other templates. There's currently a semi-interactive prototype. I think it would be useful for the module maintainers to provide feedback, if there are any issues that haven't already been addressed.

There's an early draft of a documentation page that might help explain how the software's supposed to be enabled inside template code. Jc86035 (talk) 08:33, 3 July 2019 (UTC)

Noprint
Add span class noprint in order to prevent pencils from being printed as they are not useful in printed articles. --5.43.82.5 (talk) 01:50, 2 March 2020 (UTC)

Hide link to non-existent property
The module would be better if the link is suppressed when the property specified by pid does not exist on the wikidata item. For example, the following output should be suppressed:

->

because does not exist on  &mdash; Martin (MSGJ · talk) 20:42, 24 March 2021 (UTC)

Performance change
Please apply this change to the module. It uses a lot less lua memory than the current code, while still working the same way. I made this change due to the discussion at Wikipedia talk:Lua where the pages where hitting limits due to this module. Snævar (talk) 22:50, 17 February 2022 (UTC)
 * any 2nd opinions on this; thanks for the update, now that this module is so widely used I'm just looking at updates with extreme caution!
 * I don't have the Lua knowledge to properly comment on 's changes, but they seemed to indicate all would be the same with less memory usage (which seems to be the goal). - Favre1fan93 (talk) 21:39, 18 February 2022 (UTC)
 * ❌ all of the test cases are reporting failure, can you review and comment on that? (Once resolved, reactivate the edit request). —  xaosflux  Talk 01:14, 25 February 2022 (UTC)

LOL! I saw this when pinged but ignored it because I haven't been involved here and had other things to do—see Template talk:Authority control/Archive 13 where I've just found that  uses 17MB of Lua memory at Among Us. I previewed an edit to this module to convince myself that a simple change would reduce that to well under 1MB. Then I checked the talk page to see if there was any activity. Now I see that has put the correct code in the sandbox with some other things I didn't think of! The reason Module talk:EditAtWikidata/testcases is showing failures is that the sandbox includes noprint to remove the pencil from printed articles (see the section below). That is, the output is  where   is the previous output. While we're implementing this I think the Lua code should be further cleaned up and I will have a go at that in the next day or two. Please wait before implementing to see if my tweaks are worthwhile. Johnuniq (talk) 09:38, 11 March 2022 (UTC)
 * I tweaked the code in Module:EditAtWikidata/sandbox and temporarily removed the noprint span so Module talk:EditAtWikidata/testcases works. The output includes several redundant spaces that no one can see so I plan to remove them before going live. I left them for now so the tests work. When the issue in the section below is settled I can update the module and make a small tweak in Module:Authority control to directly call the module rather than expand the template which it is doing at the moment. Johnuniq (talk) 02:36, 12 March 2022 (UTC)
 * I have updated Module:EditAtWikidata/sandbox. Previewing an edit of my sandbox2 showed that the Lua memory usage for  was 17,150,179 bytes, but adding   reduced that to 526,882 bytes. I'll update the main module soon. Johnuniq (talk) 01:59, 13 March 2022 (UTC)
 * This is now live in Module:EditAtWikidata. Johnuniq (talk) 22:51, 13 March 2022 (UTC)

Hiding pen in printouts or to non-logged in users?
I suggest that the pen icon at least should be hidden in printouts, for aesthetic reasons. That is possible using:

The pen in module:WikidataIB is always hidden to non-logged in users and other users who are not autoconfirmed. "This means that most readers don't see the pen icon, and represents a balance between aesthetics and vandalism at Wikidata on the one hand, and the desire to encourage editing Wikidata on the other." This follows from the discussion Module talk:WikidataIB/Archive_7. It is dones using:

Different pen visibility policy of different modules is very confusing. For example, my templates Area WD, Population WD and Population density WD currently behave inconsequently in this matter, because some use Module:EditAtWikidata, and others module:WikidataIB. See the table in this example article. Is it possible to harmonize the modules? Tomastvivlaren (talk) 22:55, 2 March 2022 (UTC)
 * Now I modified Area WD and Population density WD to only show the pen to auto-confirmed users, but I think it would be better if this was addressed in this module.Tomastvivlaren (talk) 00:19, 5 March 2022 (UTC)
 * This will be implemented soon. See the section just above. However, we need to sort out exactly what html should be used. The current sandbox includes  only. Exactly what do you think should be done? Johnuniq (talk) 09:44, 11 March 2022 (UTC)
 * Hiding the pen in printouts is non-controversial, and the sandbox works fine. I am not sure on if it also should be hidden to non-logged-in users, but I have included that html in some of my templates now on a trial bases. We should be open to how users react. I am waiting for response from users regarding pages where I have included the pen. In the long run, all wd-modules should do the same. Tomastvivlaren (talk) 10:01, 11 March 2022 (UTC)

Some advice please. The output from this template is shown below. There is a proposal to wrap that output with a class to prevent it from being printed and possibly also to prevent its display for non-autoconfirmed users per WP:BEANS to reduce the number of people who click the link and change hard-to-check stuff at Wikidata.

Which of these would you recommend? Anything else?

Example output follows. The output from Special:ExpandTemplates is (rearranged to multiple lines): OOjs UI icon edit-ltr-progressive.svg [[User:Johnuniq (talk) 02:28, 12 March 2022 (UTC)
 * frameless |text-top |10px
 * alt=Edit this at Wikidata
 * link=https://www.wikidata.org/wiki/Q1#identifiers
 * Edit this at Wikidata]]


 * 2 people made the autoconfirmed-show change at WikidataIB, and that discussion kind of smells and looks like one that should have been 'wider consensus needed' given that's explicitly removing the call to action. I'd reject here as well. (SILENCE or similar rationale doesn't apply because the people who would be vocal about it don't know they never had the choice.)
 * I think removing these from print is reasonable, and noprint should do that so far as I know. Any arbitrary class devised can also be added to MediaWiki:Print.css if preferred (personally, I prefer an explicit class and listing there since I would rather not spread noprint and because Print.css only loads at print time, so it's practically free to add CSS there).
 * So far as I know, is typically only used for fact and similar other "clean up" templates, so I don't see a reason to add it, but that's at an edge of my knowledge. (Also I hate that it uses capitals for a terrible, non-indicative name anyway, but that's an aside.) Izno (talk) 06:35, 12 March 2022 (UTC)
 * Anyway, you probably also can add it directly as a class on the image (what would be noprint), rather than adding a surrounding span. Izno (talk) 06:36, 12 March 2022 (UTC)
 * Thanks, although this is way over my head. Searching led me to Catalogue of CSS classes which suggests using metadata rather than noprint but I can't find any examples of that so will ignore it. I believe you are saying that the optimum procedure would be to invent some class for print.css and use that. Unless someone sufficiently clueful, and with sufficient time, does that soon I propose sticking with the self-explanatory noprint. I won't do it right now because it would mess up the testcases, but I will try  as an extra parameter inside the  . Groan, I suppose I'll then have to test it. Johnuniq (talk) 08:42, 12 March 2022 (UTC)
 * Lucky you. ;) Izno (talk) 18:05, 12 March 2022 (UTC)
 * I updated the sandbox and Module talk:EditAtWikidata/testcases now shows differences from the main module due to the new output ( in the File wikitext). I checked the diffs and they are good, and I printed a page from the testcases to confirm that the pencil icon is printed for the main module cases, but not printed for the sandbox module cases. I'll update the main module soon. Johnuniq (talk) 01:54, 13 March 2022 (UTC)