Page MenuHomePhabricator

Math formulas can be unreadable in references in mobile view
Closed, DeclinedPublic

Description

NOTE: The issue is fixed in MathML so this ticket will be obsolete when T271001 is merged.

Background

When references containing math formulas are shown with JavaScript, the formulas can be unreadable. This the case in safari and in chrome.
Example: https://en.m.wikipedia.org/wiki/Reflexive_space#Reflexive_locally_convex_spaces (click [17] - there is a hidden math icon at the end of the reference)

Screen Shot 2016-03-07 at 9.56.49 AM.png (459×415 px, 46 KB)

User story

As a reader I should be able to see math equations in the reference drawer.

Acceptance criteria

  • The images should be inverted

QA

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

awaiting more feedback on 3 possible solutions in the description. we can decide which solution to pick based on effort and value.

moving it to needs analysis till then

@Nirzar :

CSS filters are not supported in IE <= 12 according to http://caniuse.com/css-filters/embed
Given the number of IE based mobile browsers, it might be acceptable to minimise this bug to all older browsers. We currently do support IE9 but in future that will change.

Solution 1 is the easiest and has the most widest support.

Solution 3 is really up to you and a choice of design (this is previously how they looked). Reusing drawer pattern does however simplify our codebase at the expense of some additional work now.

Your choice! All 3 would work but solution 1 has the least cons.

I was surprised to find mobile references drawer on black background. Not sure, what the reason behind it was, though have a strong preference towards solution #3.
Not only does it seem not as disconnected from rest of UI as the black ones, it also has quite some maintenance advantages over the others.
References drawer external links didn't show external link icon (usefulness of this is another topic), my guess isn't only for design, but also because it's icon wasn't supported on black background.

image.png (308×1 px, 47 KB)

Moreover as @Nirzar already pointed out, there's more work to ensure contrast accessibility support of elements like title and icon.
As long as filter isn't fully supported cross-browser and support/maintenance costs are high for making this little element work, my preferred outcome would be #3.

@Volker_E just for reference, the reason was to distinguish between normal page previews drawers on mobile (which we never shipped) and the reference drawer. so as to reduce confusion. but i don't think are have that problem anymore and it can solved with strong iconography if needed

This is effectively the same as T111222.

Once again, inlining equation SVGs would help here, too (since they would become white on black just as the text).

@alexhollender I am considering this for a task relating to a future technical goal. Out of the 3 options for fixing do you have a preference on which we use? If this requires more thought no worries, I can punt this to a future technical goal, but it would be nice to fix.

CSS filters are quite widely supported now if we wanted to do the fix suggested in https://phabricator.wikimedia.org/T129054#2095664 now.

(Related issue in app T295624)

@alexhollender I am considering this for a task relating to a future technical goal. Out of the 3 options for fixing do you have a preference on which we use? If this requires more thought no worries, I can punt this to a future technical goal, but it would be nice to fix.

Can you clarify which 3 options you are referring to? Any options that allows the formulas to display is fine with me.

@alexhollender I am considering this for a task relating to a future technical goal. Out of the 3 options for fixing do you have a preference on which we use? If this requires more thought no worries, I can punt this to a future technical goal, but it would be nice to fix.

Can you clarify which 3 options you are referring to? Any options that allows the formulas to display is fine with me.

There are 3 solutions in the task description. Note, that question was from over a year ago, so I am not considering this for a technical goal right now.

@Jdlrobson it seems like all 3 options use the drawer, and the differences are whether the drawer is white or black, and whether the math formula has a white background? I'm not sure what the rules are on when the drawer is black vs when it is white, but the white one is much easier to read, so we should use that if possible:

iPhone 7 Copy.png (1×750 px, 181 KB)

if we can't use that this is fine:

pasted_file (153×489 px, 29 KB)

For reference, the Android app also uses light drawers, with and additional dark overlay for the content area:

Screenshot_20240325-104550.png (2×1 px, 357 KB)

...as does MobileFrontend for the CTA drawer, used for redlinks, and actions while logged

image.png (397×450 px, 31 KB)
image.png (397×450 px, 37 KB)

Change #1015287 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/MobileFrontend@master] Remove black background from references drawer

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

Above patch removing the black background in favour of the default:

image.png (248×459 px, 23 KB)

Note that equations are still sometimes not visible due to a newer issue with lazy loading (T361212):

image.png (248×459 px, 30 KB)

Adding to sprint 2 for consideration as there is a patch open from Ed.

Jdlrobson added a subscriber: JScherer-WMF.

@JScherer-WMF we could do with some design input from you on this one since the last design input was in 2022 and a lot has changed since then.

I don't know why Citation drawers were made black for light mode. I don't see any reason why they shouldn't follow the rest of the UI. We can make them background-color-base which would make them light in light mode. We also should have an overlay for the content like in Android. We can use the one that's implemented as part of the dialog component in codex. It uses background-color-base at 65% opacity. This still wouldn't fix the bug for dark mode, though. We would still want a dark citation drawer for dark mode.

As far as a fix for that goes. The math formulas should just have content-color-base in both colour modes. I don't understand why the formulas wouldn't share the styling of the text in which they're embedded. If we can find a solution that does that, we're good to go from my perspective.

pasted_file (153×489 px, 29 KB)

Putting this in sign-off now because I don't think we need any more design on it. Feel free to resurrect with a new description as an implementation ticket, or create a new one with the task template.

On a side-note @DTorsani-WMF what do you think about having a variant of the dialog component that works like a mobile bottom sheet? Or would that need to be its own component?

In mobile apps, those bottom sheets sometimes work like a new tab for micro flows with their own navigation stack, etc. That would be a nice affordance to have.

I don't think we would want to use them in desktop, though.

I don't know why Citation drawers were made black for light mode.

I would guess to make them obvious that they're drawers and not just random citation displaying on half a mobile page. I otherwise agree that they could follow the general color theme. I would use a darker color than background-color-base, perhaps background-color-interactive.

@JScherer-WMF It seems that a few people have responded elsewhere to the same question already so I will defer to their responses.

We also should have an overlay for the content like in Android.

We already have an overlay, see my screenshots above (not sure why they aren't in the original task description screenshots).

I don't understand why the formulas wouldn't share the styling of the text in which they're embedded.

They are currently rendered as static images in most browsers (black text on transparent) - in dark mode they get inverted. When we switch to native math rendering they will inherit the font colour.

Sounds like the rest of your recommendations are aligned with the implementation in https://gerrit.wikimedia.org/r/1015287, (see https://patchdemo.wmflabs.org/wikis/560a719650/w/index.php?title=Reflexive_space&mobile_action=toggle_view_mobile&mobileaction=toggle_view_mobile#cite_ref-8 )

Please note that changing the background colours of the citation drawers is not very high priority right now, and DST is looking at sheet components which will refactor their styling soon.

Inverting the colours of the math symbol images should do enough to make them accessible/visible for now.

@JScherer-WMF it looks like the original bug is fixed.

To add confusion this is how it's currently behaving in light and dark mode:

Screenshot 2024-05-29 at 1.32.33 PM.png (154×540 px, 18 KB)

Screenshot 2024-05-29 at 1.33.00 PM.png (261×1 px, 58 KB)

Note: This will be fixed the correct way when T271001 is merged - perhaps it's worth calling this good and enough and resolving?

Is that good enough to call this resolved, or do we want to address the non-dark mode version (if so I'll create a new ticket to avoid confusion)?

To add confusion this is how it's currently behaving in light and dark mode:

Screenshot 2024-05-29 at 1.32.33 PM.png (154×540 px, 18 KB)

Screenshot 2024-05-29 at 1.33.00 PM.png (261×1 px, 58 KB)

Note: This will be fixed the correct way when T271001 is merged - perhaps it's worth calling this good and enough and resolving?

Is that good enough to call this resolved, or do we want to address the non-dark mode version (if so I'll create a new ticket to avoid confusion)?

Yes, I'll create a bug ticket for the weird white image background.

Okay resolving this ticket!

There is still an open patch to make the reference drawer white, which I think should be merged. If we don't want to repurpose this task for it, can a new one be created.