Module talk:EditAtWikidata: Difference between revisions

Content deleted Content added
m Reverted edit by 37.39.1.6 (talk) to last version by ClueBot III
 
(14 intermediate revisions by 5 users not shown)
Line 42:
:::{{re|Xaosflux}} I don't have the Lua knowledge to properly comment on {{u|Snævar}}'s changes, but they seemed to indicate all would be the same with less memory usage (which seems to be the goal). - [[User:Favre1fan93|Favre1fan93]] ([[User talk:Favre1fan93|talk]]) 21:39, 18 February 2022 (UTC)
:{{not done}} all of the [[Module talk:EditAtWikidata/testcases|test cases]] are reporting failure, {{re|Snævar}} can you review and comment on that? (Once resolved, reactivate the edit request). — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 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#Big problem]] where I've just found that <code><nowiki>{{EditAtWikidata|pid=identifiers}}</nowiki></code> 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 {{u|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 <code><nowiki><span class="noprint">...</span></nowiki></code> where <code>...</code> 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. [[User:Johnuniq|Johnuniq]] ([[User talk: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. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:36, 12 March 2022 (UTC)
::I have updated [[Module:EditAtWikidata/sandbox]]. Previewing an edit of [[User:Johnuniq/sandbox2|my sandbox2]] showed that the Lua memory usage for <code><nowiki>{{EditAtWikidata|qid=Q96417649}}</nowiki></code> was 17,150,179 bytes, but adding <code>/sandbox</code> reduced that to 526,882 bytes. I'll update the main module soon. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 01:59, 13 March 2022 (UTC)
:::This is now live in [[Module:EditAtWikidata]]. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 22:51, 13 March 2022 (UTC)
 
== Hiding pen in printouts or to non-logged in users? ==
Line 52 ⟶ 56:
Different pen visibility policy of different modules is very confusing. For example, my templates {{tl|Area WD}}, {{tl|Population WD}} and {{tl|Population density WD}} currently behave inconsequently in this matter, because some use Module:EditAtWikidata, and others module:WikidataIB. See the table in this [https://en.wikipedia.org/w/index.php?title=List_of_Brazilian_states_by_population_density&oldid=1075098058 example article]. Is it possible to harmonize the modules? [[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 22:55, 2 March 2022 (UTC)
:Now I modified {{tl|Area WD}} and {{tl|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.[[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 00:19, 5 March 2022 (UTC)
::{{ping|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 <code>class="noprint"</code> only. Exactly what do you think should be done? [[User:Johnuniq|Johnuniq]] ([[User talk: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 (<code><nowiki> <span class='penicon autoconfirmed-show'>...</span> </nowiki></code>) 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. [[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 10:01, 11 March 2022 (UTC)
{{od|3}}{{ping|Izno|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?
#<code><nowiki><sup class="noprint">...</sup></nowiki></code>
#<code><nowiki><sup class="noprint Inline-Template">...</sup></nowiki></code>
#<code><nowiki><span class="penicon autoconfirmed-show">...</span></nowiki></code>
 
Example output follows.
*<code><nowiki>{{EditAtWikidata|pid=identifiers|qid=Q1}}</nowiki></code> → {{EditAtWikidata|pid=identifiers|qid=Q1}}
The output from [[Special:ExpandTemplates]] is (rearranged to multiple lines):
<pre>
[[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]]
</pre>
[[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:28, 12 March 2022 (UTC)
 
: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, {{tt|Inline-Template}} is typically only used for {{tl|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.) [[User:Izno|Izno]] ([[User talk: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 {{para|class|noprint}}), rather than adding a surrounding span. [[User:Izno|Izno]] ([[User talk:Izno|talk]]) 06:36, 12 March 2022 (UTC)
:::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 <code>|class=noprint</code> as an extra parameter inside the <code><nowiki>[[File:....]]</nowiki></code>. Groan, I suppose I'll then have to test it. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 08:42, 12 March 2022 (UTC)
::::Lucky you. ;) [[User:Izno|Izno]] ([[User talk: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 (<code>|class=noprint</code> 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. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 01:54, 13 March 2022 (UTC)