[go: up one dir, main page]

Page MenuHomePhabricator

Preview not working with MathML rendering
Open, MediumPublic

Description

Currently, the Extension:Popup preview is only working in SVG mode.

mathPopup.png (618×832 px, 79 KB)

Working preview in SVG mode.
Does not work with MathML.
Tested in Firefox(131.0) / Google Chrome(131.0.6778.86)

Event Timeline

@FrederikHennecke1 Thank you for reporting.

  1. Did you analyze why the popup is not showing?
  2. Is there any output in the browser's console?
  3. Are there tests (e.g., selenium tests from @zeljkofilipin) that test the feature for SVG (codename MathML mode)?
  4. If yes, can those tests be extended to cover the MathML popup?
  5. How is the situation with other browsers?

To give you a rough overview of what is required to fix the issue, please find relevant links for becoming a MW hacker

zeljkofilipin moved this task from Backlog 🪒 to Deep work 🌊 on the User-zeljkofilipin board.
  1. Are there tests (e.g., selenium tests from @zeljkofilipin) that test the feature for SVG (codename MathML mode)?

I'll take a look, but sometime next week.

  1. Did you analyze why the popup is not showing?

Because the popup module is currently looking for image tags inside .mwe-math-element elements with data-qid attributes, and the MathML mode is not using any images or the data-qid attribute.

  1. Is there any output in the browser's console?

No.

  1. How is the situation with other browsers?

I just also tested in MS Edge 131.0.2903.70 and Safari 14.1. where it's also broken.

Change #1099091 had a related patch set uploaded (by FrederikHennecke1; author: FrederikHennecke1):

[mediawiki/extensions/Math@master] Fix Preview not working with MathML rendering

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

Change #1099091 merged by jenkins-bot:

[mediawiki/extensions/Math@master] Fix Preview not working with MathML rendering

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

Hi @FrederikHennecke1 and @Physikerwelt. I don't understand what the problem is. Can you link to the page where the problem appears? What did you do? What did you expect to happen?

  1. Are there tests (e.g., selenium tests from @zeljkofilipin) that test the feature for SVG (codename MathML mode)?

As far as I can see, The only Math related test just checks if the formula is present on the page:

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Math/+/refs/heads/master/tests/selenium/specs/basic.js

  1. If yes, can those tests be extended to cover the MathML popup?

Probably, but I don't really understand what should be tested.

Hi @zeljkofilipin, thank you for getting back to this.

Hi @FrederikHennecke1 and @Physikerwelt. I don't understand what the problem is. Can you link to the page where the problem appears? What did you do? What did you expect to happen?

Normally, if one visits https://en.wikipedia.org/wiki/Mass%E2%80%93energy_equivalence in a private window without any cookies or user settings, one sees popups for wiki-links and the first formula that has the property qID. See the screenshot in the ticket. The feature is currently broken: https://phabricator.wikimedia.org/T381310

It would be nice to have failing tests if the feature breaks.

In addition, the feature did not work depending on the user settings. It didn't work in MathML mode, especially. This was fixed by https://gerrit.wikimedia.org/r/1099091

Would that test live in Math or Popups repository? Does Math already have a dependency on Popups (or vice versa)?

As far as I can see, both Math and Popups don't declare any dependencies besides MediaWiki.

To create the test, I need a working popup. Which revision of which repository do I have to have locally to get the popup working? Is it working anywhere on a public wiki (beta cluster, patch demo...)?

Would that test live in Math or Popups repository? Does Math already have a dependency on Popups (or vice versa)?

I think it would live in math @Jdlrobson ? And there is no hard dependency as this feature is nice to have but not essential for any of the extensions.

@FrederikHennecke1 Can you document as a step-by-step guide what you did to get the popups working locally?

It's almost working on beta https://en.wikipedia.beta.wmflabs.org/wiki/T381046 despite that no property "in defining formula" seems to exist.

It's almost working on beta https://en.wikipedia.beta.wmflabs.org/wiki/T381046 despite that no property "in defining formula" seems to exist.

This works with the (old) has part way

Change #1101834 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):

[operations/mediawiki-config@master] Add new properties for math popups

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

@FrederikHennecke1 Can you document as a step-by-step guide what you did to get the popups working locally?

Here are the steps:

  1. Have up-to-date mediawiki installed (I have 1.44.0-alpha, but 1.43 should also work)
  2. Install Wikibase (both 1.44.0-alpha and 1.43 work)
    • Extension:Wikibase Repository
    • Extension:Wikibase Client
  3. Install Extension:Popups (I'm currently using 1.44.0-wmf.6, but it also works with 1.43)
    • Has dependency on Extension:TextExtracts and Extension:PageImages
  4. Install Extension:Math (Most recent from master)
  5. Create a wikibase item (/wiki/Special:NewItem) [optional] with the needed propertys (like https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Special:MathWikibase&qid=Q632474)
    • I can send you a short python script to automate this if you want.
    • Name and Description are the most important parts. The propertys are not that important.
    • If you really want these properties to work, then you also have to change the property keys in Math/extension.json (line 174-193) or change them in your setting:
$wgMathWikibasePropertyIdDefiningFormula = 'P308';
$wgMathWikibasePropertyIdInDefiningFormula = 'P311';
$wgMathWikibasePropertyIdSymbolRepresents = 'P310';
  1. Create a page with a <math> formula and link it to the QID of the created wikibase item(Like https://en.wikipedia.beta.wmflabs.org/wiki/T381046)
  2. Turn on MathML and 'Explain mathematical formulae on hover.' in your account preferences
  3. For testing, you should use Firefox because Chrome does currently not support href attributes in <math>. (The popup does work in both browsers, but the href link only works in firefox.)

Here are my settings:

# End of automatically generated settings.
# Add more configuration options below.
$wgMaxArticleSize = 4096;
$wgAPIMaxResultSize = 268435456;

$wgShowExceptionDetails = true;
wfLoadExtension( 'Math' );
$wgMathValidModes[] = 'mathml';
$wgDefaultUserOptions['math'] = 'mathml';
$wgMathMathMLUrl = 'http://12.23.34.45:10042/'; # IP of Mathoid server
wfLoadExtension( 'Popups' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" );
require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php";
wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" );
require_once "$IP/extensions/Wikibase/client/ExampleSettings.php";
$wgWBRepoSettings['allowEntityImport'] = true;

Change #1101834 merged by jenkins-bot:

[operations/mediawiki-config@master] Add new properties for math popups

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

I think it would live in math @Jdlrobson ? And there is no hard dependency as this feature is nice to have but not essential for any of the extensions.

Yes ideally any tests would be in Math, which would be run by Popups on all patches.

Change #1105072 had a related patch set uploaded (by Krinkle; author: FrederikHennecke1):

[mediawiki/extensions/Math@REL1_43] Fix Preview not working with MathML rendering

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

Change #1105072 merged by jenkins-bot:

[mediawiki/extensions/Math@REL1_43] Fix Preview not working with MathML rendering

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