Module talk:EditAtWikidata

(Redirected from Module talk:EditAtWikidata/sandbox)
Latest comment: 2 years ago by Johnuniq in topic Performance change

Edit request June 2019 edit

There is a request here ({{Official URL}}) 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 {{official URL/sandbox}}). 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. @Xaosflux:. -- GreenC 14:32, 18 June 2019 (UTC)Reply

@Volker E. (WMF): - 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)Reply
@GreenC: 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)Reply
@Xaosflux: 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 phab:T213778. – Volker E. (WMF) (talk) 03:32, 19 June 2019 (UTC)Reply
  Donexaosflux Talk 13:17, 19 June 2019 (UTC)Reply

Wikidata Bridge edit

(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)Reply

Noprint edit

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)Reply

Hide link to non-existent property edit

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:

{{#invoke:EditAtWikidata|showMessage|pid=P3563|qid=Q106166201}} ->  

because NGA lighthouse ID (P3563) does not exist on Out Skerries Light (Q106166201) — Martin (MSGJ · talk) 20:42, 24 March 2021 (UTC)Reply

Performance change edit

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#Errors on List of Marvel Cinematic Universe films where the pages where hitting limits due to this module. Snævar (talk) 22:50, 17 February 2022 (UTC)Reply

@Zyxw, Nardog, PrimeHunter, Johnuniq, and Favre1fan93: any 2nd opinions on this; @Snævar: thanks for the update, now that this module is so widely used I'm just looking at updates with extreme caution!
@Xaosflux: I don't have the Lua knowledge to properly comment on Snævar'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)Reply
  Not done all of the test cases are reporting failure, @Snævar: can you review and comment on that? (Once resolved, reactivate the edit request). — xaosflux Talk 01:14, 25 February 2022 (UTC)Reply

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#Big problem where I've just found that {{EditAtWikidata|pid=identifiers}} 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 Snævar 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 <span class="noprint">...</span> 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)Reply

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)Reply
I have updated Module:EditAtWikidata/sandbox. Previewing an edit of my sandbox2 showed that the Lua memory usage for {{EditAtWikidata|qid=Q96417649}} was 17,150,179 bytes, but adding /sandbox reduced that to 526,882 bytes. I'll update the main module soon. Johnuniq (talk) 01:59, 13 March 2022 (UTC)Reply
This is now live in Module:EditAtWikidata. Johnuniq (talk) 22:51, 13 March 2022 (UTC)Reply

Hiding pen in printouts or to non-logged in users? edit

I suggest that the pen icon at least should be hidden in printouts, for aesthetic reasons. That is possible using: <sup class="noprint Inline-Template">...</sup>

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#Visibility of pen icon. It is dones using: <span class='penicon autoconfirmed-show'>...</span>

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)Reply

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)Reply
@Tomastvivlaren: 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 class="noprint" only. Exactly what do you think should be done? Johnuniq (talk) 09:44, 11 March 2022 (UTC)Reply
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 ( <span class='penicon autoconfirmed-show'>...</span> ) 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)Reply

@Izno and WOSlinker: 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?

  1. <sup class="noprint">...</sup>
  2. <sup class="noprint Inline-Template">...</sup>
  3. <span class="penicon autoconfirmed-show">...</span>

Example output follows.

  • {{EditAtWikidata|pid=identifiers|qid=Q1}} 

The output from Special:ExpandTemplates is (rearranged to multiple lines):

 [[File:OOjs UI icon edit-ltr-progressive.svg
|frameless |text-top |10px
|alt=Edit this at Wikidata
|link=https://www.wikidata.org/wiki/Q1#identifiers
|Edit this at Wikidata]]

Johnuniq (talk) 02:28, 12 March 2022 (UTC)Reply

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, Inline-Template 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)Reply
Anyway, you probably also can add it directly as a class on the image (what would be |class=noprint), rather than adding a surrounding span. Izno (talk) 06:36, 12 March 2022 (UTC)Reply
Thanks, although this is way over my head. Searching led me to Wikipedia: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 |class=noprint as an extra parameter inside the [[File:....]]. Groan, I suppose I'll then have to test it. Johnuniq (talk) 08:42, 12 March 2022 (UTC)Reply
Lucky you. ;) Izno (talk) 18:05, 12 March 2022 (UTC)Reply
I updated the sandbox and Module talk:EditAtWikidata/testcases now shows differences from the main module due to the new output (|class=noprint 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)Reply