mathjax / MathJax

Beautiful and accessible math in all browsers
http://www.mathjax.org/
Apache License 2.0
10.09k stars 1.16k forks source link

Enabling MathML on Demos page can cause renderer choice to be sticky #745

Closed Blaisorblade closed 9 years ago

Blaisorblade commented 10 years ago

If I enable MathML in the MathML demos, I can't switch back — not without manually clearing a cookie.

When I enabled MathML rendering, I got a warning that it was not supported on my browser (Chrome 32). I was curious, so I enabled it anyway, but it turned out that the warning was right. So I switched back to HTML+CSS, and then reloaded the page. But on reloading, the page was rendering again through MathML! Even though there's a selector on that page, on every reload both the selector and the rendering mode were reset to MathML.

The same happened on the TeX demos, and I started fearing I broke MathML also for other websites (which was probably irrational).

Without an option to clear the default (I had changed the default? Nobody told me!), I had to manually remove the offending cookie*. This worked, but I shouldn't be required to take such measures.

*I found a cookie named mjx.menu with content renderer%3ANativeMML%26%3Bwarned%3Atrue, and removing it fixed the issue for me.

pkra commented 10 years ago

I'm not sure I understand the issue. (For the record, everything works as expected on Chrome 32 on linux).

So I switched back to HTML+CSS, and then reloaded the page.

You shouldn't have to -- the script is set up to refresh the rendering on the fly. Did it not refresh the MathJax output?

But on reloading, the page was rendering again through MathML!

Again, this shouldn't be necessary. Perhpas you interrupted the update and the cookie value wasn't changed? Or perhaps something else interfered. Hard to tell.

Without an option to clear the default (I had changed the default? Nobody told me!), I had to manually remove the offending cookie*.

Indeed, there is an easier way -- you can use the MathJax menu. Just right-click on some math content => Math Settings => Math renderer => HTML-CSS

Blaisorblade commented 10 years ago

You shouldn't have to -- the script is set up to refresh the rendering on the fly. Did it not refresh the MathJax output?

It did. However, if I then go to the TeX demos, it will remember the MathML setting.

However, this only happens if I select the renderer via the drop-down list near the top of the page, next to "Select the rendering mode". In that case, the webpage is updated to use the selected renderer, but the cookie is not updated.

If I instead use the MathJax menu you mention, the webpage is refreshed, cookie is updated correctly to renderer%3AHTML-CSS%26%3Bwarned%3Atrue, and the dropdown box is updated.

BTW, this context menu is really neat, and thank for telling me, but for some reason it wasn't really discoverable for me (though I'm usually considered a power user). Maybe because there's no visible control around the formulas?

Perhpas you interrupted the update and the cookie value wasn't changed? Or perhaps something else interfered. Hard to tell.

I tried again, and I can exclude I interrupted the update. However, I can't exclude some extension is interfering with MathJax — certainly Markdown Here is interfering with my attempts at debugging. I'll try again with extensions disabled.

pkra commented 10 years ago

I just tested this on OSX 10.9 as well and everything behaves as expected. Hopefully, it's just a Chrome extension interfering.

BTW, this context menu is really neat, and thank for telling me, but for some reason it wasn't really discoverable for me (though I'm usually considered a power user).

Thanks for the comment. We actually have such a feature but it's not yet finished. For a demo, see http://www.math.union.edu/~dpvc/test/MathJax-Discoverable.html

dpvc commented 10 years ago

The issue here is really not with MathJax so much as with the example page. That page lets you change the renderer without changing the cookie, so that you can see the different renderers without having to change to one permanently.

The problem came when the dialog indicating that Chrome doesn't support MathML was issued. MathJax saves the fact that the dialog was issued (so you won't see it again) in its cookie, and the act of saving that state also caused the current renderer to be saved. Since you have OKed the switch to MathML output, that was what was saved. Because the menu in the page doesn't usually save the cookie, using it to change back to HTML-CSS didn't reset the cookie value. (No dialog was issued for that.) Reloading the page doesn't change things because the cookie is used to override the renderer selected by the page. Setting the renderer through the contextual menu does save the cookie, which is why doing that lets you set the renderer back to what you wanted.

The page should be made smarter so that when the dialog is issued, the original renderer is put back into the cookie rather than the new one.

In any case, it is specific to this particular page, and not to MathJax as a whole.

Blaisorblade commented 10 years ago

@dpvc, I can confirm your analysis fits with all my observations.

In any case, it is specific to this particular page, and not to MathJax as a whole.

Makes sense. It still gave me the wrong impression, but it's just a bad advertisement for unlucky new users, not a bug for the existing ones.

@pkra:

For a demo, see http://www.math.union.edu/~dpvc/test/MathJax-Discoverable.html

Now that I've seen it work, it seems cool, I like the interface! I had some trouble getting it to work, but it might have been me, or some maturity bug. If there's a point, I can try isolating the problem.

dpvc commented 10 years ago

it's just a bad advertisement for unlucky new users, not a bug for the existing ones.

The page should be fixed, for sure, but I'm glad it is not something that will be affecting other people's sites.

I had some trouble getting it to work

Can you say more about that? What went wrong or didn't work or didn't work as you expected it to? I assume you checked the "Discoverable" checkbox in the control panel first. Note that you do have to hover over the math for a bit before the highlighting occurs.

Blaisorblade commented 10 years ago

Note that you do have to hover over the math for a bit before the highlighting occurs.

Exactly, the delay was quite long for me. And the control panel itself was a bit confusing, but probably it wouldn't be part of the interface. See below for the details of my "discovery path".

My impressions (even though I'm no usability expert):

  1. if you want to do usability testing of the actual feature, I have the impression your demo should not contain the panel, and should have all the checkboxes preactivated. (Assuming, again, the control panel is not part of the finished interface).
  2. Is this interface more discoverable? I do guess so, but I have no good way of telling. But the activation delay might be a bit too long, especially for the first time.
  3. Is it discoverable enough? I'm not sure I can suggest no obvious way to improve it, because hidden controls are known to be dangerous but equations should have no visible controls.
  4. Proposal: show the controls while the page is loading/rendering (at least as long as you have the progress messages on the lower-left corner), and then after the page has stabilized, blend the controls out somewhat slowly, so that the eye will pick out the animation compared to the still page and one will move the house toward the controls.

I happened to figure out things after a very convoluted path. I'll write down what I think was my discovery path anyway (but it's a flawed reconstruction, I did more steps I forgot).

I cleared the cookie on that page and tried to reproduce the experience, and here's what I think had happened:

— Mark "Discoverable Checkbox", notice no change. — Mark "Outline Haze", notice no change. — After some attempts (including a page reload, which wouldn't have been needed in fact, but I only noticed later), discover that all goodies appear under "Math Settings" in the contextual menu — that was a bit hidden. (But again, more about the panel). — Play a bit with "Highlight on Hover" — I think "Hover" was the key hint for me. — Then at some point I finally did hover on the images and notice the Outline Haze and the contextual menu. After the first time, the delay feels maybe shorter.

dpvc commented 10 years ago

The panel is not part of MathJax, it is just there to allow you to experiment with the interface. It is not something anyone using MathJax on other pages would see. As you found, there are some contextual menu items that can be used to control the discoverability and other MathJax UI features, and those could be available to users, but they are currently off by default.

When you say the first one took a long time, can you say how long? Note that hovering really means motionless hovering, so if you move the mouse, it doesn't count as hovering, even if it remains over the same math expression. The delay time could, of course, be changed.

Blaisorblade commented 10 years ago

The panel is not part of MathJax, it is just there to allow you to experiment with the interface.

That confirms my guesses. But I believe if your question is "is this GUI X discoverable", which I think is related to what we're discussing, you don't want the panel there, you want the actual GUI X, not X' or X'', for the next user you show your beta. Because I believe for each user you can only ask this question once.

When you say the first one took a long time, can you say how long? Note that hovering really means motionless hovering, so if you move the mouse, it doesn't count as hovering, even if it remains over the same math expression.

Interesting. Now that you say that, it seems fine. Really hard to say, I don't have a stopwatch — if I try again now, it seems fine — though slower than Eclipse tooltips. To be clear, I don't guess there's a technical problem with the code.

But by now I have discovered the interface — I know consciously and subconsciously that I have to hover. In my first test, I was mostly trying again and again to use the control panel and see something on the webpage change, because I had the completely wrong expectation — so my mouse cursor was on the panel for quite a while, until I started playing with the contextual menu. And again, the problem I actually had was partly with the panel. So I fear I'm useless as a tester to you now on this point — I wrote my educated guesses on what my initial experience would have been without the panel. And I'm sorry I can't provide good answers to your questions. I really appreciate your concern though.

dpvc commented 10 years ago

The page you were looking at was simply a test page that allowed me to experiment with the different features as they were being developed. It was not designed as a test page for people to determine if the discoverability was really discoverable for them. Sorry that the panel misled you (it was there really so that I didn't have to keep editing the file in order to test different configurations).

pkra commented 9 years ago

Closing this in favor of https://github.com/mathjax/MathJax-website/issues/19