Page MenuHomePhabricator

It should be possible to disable Math preview type
Closed, ResolvedPublic

Description

Currently the Math preview type (added in T208758) is unconditionally registered and the user has no way to disable it in the same way they disable page previews despite there being a settings config visible.

Example page:
https://en.wikipedia.beta.wmflabs.org/wiki/Mass%E2%80%93energy_equivalence

This will require a change in the Popups extension.
When that change is done it should be as straightforward as adding a preference and some messages (example https://github.com/jdlrobson/mediawiki-skins-skinjson/pull/18)

Event Timeline

Change 859574 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Popups@master] Generalize settings code

https://gerrit.wikimedia.org/r/859574

Change 859574 merged by jenkins-bot:

[mediawiki/extensions/Popups@master] Generalize settings code

https://gerrit.wikimedia.org/r/859574

Change 966647 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Math@master] WIP: Should be possible to disable preview

https://gerrit.wikimedia.org/r/966647

Change 967306 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Popups@master] Generalize settings code (attempt 2)

https://gerrit.wikimedia.org/r/967306

Jdlrobson added subscribers: phuedx, Physikerwelt.

@Physikerwelt https://gerrit.wikimedia.org/r/966647 should be ready for testing and review. @phuedx and I are working on this in a volunteer capacity and I made a mistake in the original version of https://gerrit.wikimedia.org/r/967306, so sorry this is taking so long. Hopefully the new patch works as advertised.

@phuedx let me know if you want to chat through these patches at any time.

Change 966647 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Math@master] Should be possible to disable the Math preview

https://gerrit.wikimedia.org/r/966647

Thank you. I tested on beta.

Screenshot 2024-01-11 at 11.03.23.png (690×1 px, 85 KB)

I don't see an option for math with Chrome. Note that the popups don't work at all in Firefox with MathML.

I don't see an option for math with Chrome.

I see the following in my browser's console (Chrome v120.0.6099.199, Firefox v121.0.1), when I visit https://en.wikipedia.beta.wmflabs.org/wiki/Mass%E2%80%93energy_equivalence:

[Popups] No setting for math registered. Please create message with key "popups-settings-option-math" if this is a mistake.

IIRC we don't show the option to toggle the preview type if we can't show a message.

Note that the popups don't work at all in Firefox with MathML.

I see the following on the above page in Firefox v121.0.1:

Screenshot 2024-01-11 at 10.36.37.png (2×2 px, 1 MB)

and on the Polar bear page:

Screenshot 2024-01-11 at 10.35.20.png (2×2 px, 1 MB)

I see the problem is not related to firefox but to MathML rendering. I added a dedicated test section on

https://en.wikipedia.beta.wmflabs.org/wiki/Mass%E2%80%93energy_equivalence

Change 966647 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Should be possible to disable the Math preview

https://gerrit.wikimedia.org/r/966647

As a logged-in user, everything works as expected. The setting is here:

Screenshot 2024-01-11 at 21-45-40 Preferences - Wikipedia the free encyclopedia.png (4×3 px, 1 MB)

However, without logging in I could not change if popups occur or not. I also added action=purge. When I tried adding debug=true the popup didn't show up (even after some seconds of waiting).

Physikerwelt added subscribers: Andreg-p, SalixAlba.

@SalixAlba @Andreg-p do you think we should notify users about this upcoming change?

... probably the magic of some browser cache...

Screenshot 2024-01-11 at 22.06.40.png (1×3 px, 428 KB)

Jdlrobson edited projects, added Page-Previews (Tracking); removed Page-Previews.

Can this be closed now?