Page MenuHomePhabricator

Mediaviewer button feels tight (differs from Codex demo)
Closed, ResolvedPublicBUG REPORT

Description

For example at https://commons.wikimedia.org/wiki/File:Six_WTC_SW_Corner.jpg

Screenshot 2023-09-06 at 16.49.54.png (260×1 px, 41 KB)

On its own, without comparing to the OOUI equivalent or Codex demo, it feels like the text is too far down in the button, and the icon is lacking in padding, a bit too small of a box and/or too large an icon.

Comparing to https://doc.wikimedia.org/codex/latest/components/demos/button.html, it seems the button is meant to be 32x32, an icon of 20x20px, and 5px inner padding.

In actuality, the above is: 34x32px, an icon of 23x23px, and (still) 5px inner padding.

If I hack the following changes, it starts to look a lot better, I think. Or at least, it matches the Codex demos size and proportions.

(Flip between screenshots to compare):

.mw-mmv-filepage-buttons .mw-mmv-view-config .cdx-button__icon {
    min-width: 20px;
    min-height: 20px;
-  width: 1.4285714em;
-  height: 1.4285714em;

@media { .mw-mmv-filepage-buttons .mw-mmv-view-config .cdx-button__icon {
- mask-size: calc(max(1.4285714em,20px));
+ mask-size: 20px;

Screenshot 2023-09-06 at 16.54.57.png (260×1 px, 40 KB)

Codex was added in MMV via change 933604 as part of T340258: MMV should use Codex instead of mediawiki ui. It calls .cdx-mixin-css-icon() from MediaWiki core / Codex library. \cc @Catrope @Volker_E

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

cc @egardner who did the MediaViewer Codex migration.

I think the reason this happens is because the Codex styles assume a font size of 14px, but there is a MediaSearch style that sets all buttons to have a font size of 16px (specifically 1rem). Long-term, we'll be able to avoid bugs like these by having Codex use rems instead of ems (see T343316), but for now we should probably just change the MMV styles to not mess with the buttons' font size.

Specifically, the style being applied here is

.mw-mmv-filepage-buttons {
    font-size: 1rem;
}

@Catrope I migrated MediaSearch to Codex, but I have not touched MMV at all. Did Web start porting part of this over?

CCiufo-WMF changed the subtype of this task from "Task" to "Bug Report".
CCiufo-WMF added a subscriber: Jdlrobson.
CCiufo-WMF subscribed.

@Jdlrobson adding you because you +2'd the original patch

Jdlrobson added a subscriber: ovasileva.

@CCiufo-WMF I think the crux of the problem is that MultimediaViewer is using a component in an unsupported way and the extension is currently not actively unmaintained which makes it hard to address this (the extension mixes OOUI with Codex which is not an ideal state to be in!). I've been trying to make a case for web team to maintain it without much luck.

In this case it does seem like something regressed (possibly relating to the font size changes the web team recently made). Here's the same button in MediaWiki UI (from archive.org link) for comparison:

Screenshot 2023-12-12 at 11.47.23 AM.png (124×602 px, 12 KB)

It seems like the icons are too big and the font size is too large: that could be addressed by removing font-size: 1rem declaration and using @param-size-icon: @size-icon-small inside the Codex mixin.

But looking at other buttons in MMV, it seems like they are impacted too.

For example does the blue button in the bottom right corner intentionally this big (it looks so from the code)?

Screenshot 2023-12-12 at 11.56.19 AM.png (1×2 px, 2 MB)

I can provide code review for a bug fix here, or provide a patch if we can find someone able to review my change but ideally we'd find a team to own this important extension. Adding @ovasileva for visibility.

I reached out to Mark on Structured Data team per https://www.mediawiki.org/wiki/Developers/Maintainers and his team can hopefully provide review, so I'll post a patch.

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

[mediawiki/extensions/MultimediaViewer@master] Fixes button sizes on file page and overlay

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

After:

Screenshot 2023-12-13 at 7.11.52 AM.png (138×648 px, 16 KB)

I've intentionally not restored the block style of the button (e.g. disabling border-radius) because that seems like it might create more issues on the long run given it's unsupported.

Change 982862 merged by jenkins-bot:

[mediawiki/extensions/MultimediaViewer@master] Fixes button sizes on file page and overlay

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

Thank you @Jdlrobson ! sorry this took a while to triage on our side. We're trying to improve our intake process and as part of that we've been cleaning up tasks that we hadn't found a home / owner for.

Will let structured data team do any QA/sign off.

Etonkovidova subscribed.

Checked on commons wmf.10 - the fixes are in place:

Screen Shot 2023-12-20 at 7.02.23 PM.png (452×2 px, 211 KB)
Screen Shot 2023-12-21 at 3.37.15 PM.png (1×3 px, 2 MB)