Jump to content

Module talk:Coordinates/Archive 3

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2Archive 3

Protected edit request on 29 May 2023

Copy the code from Module:Coordinates/sandbox to the main module. I adjusted the code so coordinsert works properly with the indicator in the title. The only difference to the output is that inline coordinates are now wrapped in a <span class="geo-inline">...</span> tag, but I don't see anywhere where this would be an issue. I also added some manual testcases for when display=title and when display=inline title to verify the changes. The difference between the sandbox and module can be seen here. BrandonXLF (talk) 19:41, 29 May 2023 (UTC)

 Done also made the change to coord2text noted above — Martin (MSGJ · talk) 15:00, 5 June 2023 (UTC)
@BrandonXLF and MSGJ: based on timing, it appears that this change has broken page previews. For instance, hovering over Free City of Danzig shows just the coordinates, rather than the beginning of the article as it should. I haven't looked too closely to see whether this is a bug in the module or page previews, but you ought to consider reverting. Vahurzpu (talk) 03:15, 6 June 2023 (UTC)
This needs to be done, but I favor leaving it as is for a short period to allow debugging. Johnuniq (talk) 03:54, 6 June 2023 (UTC)

I'm trying to find the documentation to see what popups needs. It starts at mw:Page previews but I don't think there is anything relevant there apart from the link to the implementation at mw:Special:MyLanguage/Extension:Popups. That has a FAQ with two items reproduced below without the links.

  • How can I remove content from a page preview? Any element marked with the noexcerpt class will be stripped from the summary.
  • Where do summaries come from? These are provided by the summary REST API or the TextExtracts API in case your wiki is using the default mwApiPlain gateway.

Some investigation might show why the new coordinates code is messing up the popup preview or how it can be fixed. BrandonXLF is not active at the moment but I'm pinging to alert them. Johnuniq (talk) 03:54, 6 June 2023 (UTC)

Strangely, hovering over Tokyo shows a proper popup. A lot of other location links on that page also work. Some examples where the popup does not work (it shows the coordinates) are Australia (continent) and Regional Representative Council and United Arab Emirates, as reported at Template talk:Coord#Preview page broken. Johnuniq (talk) 05:05, 6 June 2023 (UTC)
The three listed pages have their coords templates defined outside the infobox. None of them are defined with inline accordingly.
I don't know why that matters, but that's the obvious pattern. Izno (talk) 05:32, 6 June 2023 (UTC)
This smells like phab:T334273: because the inline text is hidden via TemplateStyles, and the extracts module doesn't care about TemplateStyles, it decides the text that is being dumped out in the geo-inline is Good Enough. It doesn't have an issue with infobox things because it already yanks all of that before consideration of what it thinks the first paragraph should be.
As you can see, I've already argued that this is a flawed expectation for how TemplateStyles should interact with TextExtracts.
We can probably work around this locally by adding the noexcerpt class. Izno (talk) 05:39, 6 June 2023 (UTC)
Independently of workarounds, this looks to me like a parsing bug, so I filed T338204 to report it to the maintainers. --JCrespo (WMF) (talk) 07:44, 6 June 2023 (UTC)
Also sounds like we are prepending something instead of the safer option of appending ? —TheDJ (talkcontribs) 08:28, 6 June 2023 (UTC)
No? Izno (talk) 16:59, 6 June 2023 (UTC)
After the recent edit to Module:Coordinates and an low-substance edit on Australia (continent) the coordinates no longer appear. The REST endpoint is still picking up the empty p and newlines: extract: "\n\n"; extract_html: "<p>\n\n</p>". Yes, I think it was changing it from a div to a span that did this particular line in. I think we can fix this by changing the hidden inline back to a div and then doing a second passover looking for a div in coordinsert, or changing the regex to be a bit more greedy at the beginning by removing its dependence on the tag. Izno (talk) 17:12, 6 June 2023 (UTC)

Protected edit request on 28 September 2023

Add a format=dec4 function to output decimal degrees rounded to four places from data entered as either DMS or higher precision DEC format. The Canadian Geographical Names Database, Geographic Names Information System, and Ordinance Survey provide location information with seven decimal degrees of precision. The dec4 format will permit the input data to be checked with the original data source while displaying the more reasonable and compact four decimal degrees of precision (+/- 10 m).  Buaidh  talk e-mail 21:57, 28 September 2023 (UTC)

 Not done This is a repost of Module talk:Coordinates/Archive 2#Protected edit request on 14 September 2022, which was closed as needing to be sandboxed and tested. We're a year and two weeks later, and this still hasn't AFAICS been sandboxed and tested. * Pppery * it has begun... 22:16, 28 September 2023 (UTC)