Page MenuHomePhabricator

Thumbnail: Thumbnails should have relative sizes
Closed, ResolvedPublic

Description

Background

Thumbnails are small image previews that support and clarify the meaning of the content they accompany. So far, we detected three main component use cases for thumbnails: within MenuItems, landscape oriented Cards and (the potentially future) ListItems.

In all mentioned circumstances, thumbnails accompany text which size is defined in a relative way, so it reacts to any custom font-size user preference. Given that thumbnails, instead, are sized using absolute units, they currently fail to adjust and keep their vertical alignment with said content:

Screenshot 2022-07-07 at 20.59.55.png (472×1 px, 77 KB)

A relative approach to the sizing of thumbnails was originally implemented in the WVUI TypeaheadSearch component in Vector 2022, which results in a fully responsive component:

Screenshot 2022-07-07 at 21.12.36.png (1×2 px, 1 MB)

Goal

We should consider applying relative sizes to thumbnails. This way, they would also proportionally adjust whenever the font size of the content they accompany is modified.

Considerations

We already took a relative approach to sizing icons under the same circumstances/use case, so this proposal would bring extra consistency.

If we decide to move ahead with this relative sizing approach, we'll need to figure out how to implement this without causing any regressions in the TypeaheadSearch component.

This task depends on the outcome of T312580: [Needs discussion] Thumbnail should be resizeable.

Acceptance criteria

Design resources

  • Relative sizing is well-documented on the component spec sheet in Figma and on the Icon component's demo page

Development

  • The Thumbnail component is updated to use relative sizing

Event Timeline

Out of engineering enclave: We should go with em based sizing for now until we've got enough capacity for a general theming/rem approach.

Volker_E renamed this task from [Needs discussion] Thumbnails should have relative sizes to Thumbnail: Thumbnails should have relative sizes.Jul 21 2022, 12:23 PM

@Catrope These tasks are related in terms of motivation: it makes sense to adjust the size of these media type of elements to be more balanced with the text they accompany.

Change 869274 had a related patch set uploaded (by VolkerE; author: Catrope):

[design/codex@main] build, tokens, styles: Introduce simple unit transform

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

For me this task is about using relative sizes – em, rem or % – for the thumbnails. T312580 is in my reading more about having an option to custom size them or provide different default sizes. Was following the task description here, to make T312580 a parent task, but there's no dependency.
Thumbnails must be in relative sizes to provide a satisfying experience for folks scaling up their text size preferences.

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/bf2faf093a/w

Also created a Codex documentation site:
https://patchdemo.wmflabs.org/wikis/bf2faf093a/w/build/codex/docs

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/bf2faf093a/w/

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/595f8966a0/w

Also created a Codex documentation site:
https://patchdemo.wmflabs.org/wikis/595f8966a0/w/build/codex/docs

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/595f8966a0/w/

Test wiki created on Patch demo by ATomasevich (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/71dd00c269/w

Also created a Codex documentation site:
https://patchdemo.wmflabs.org/wikis/71dd00c269/w/build/codex/docs

Change 869274 merged by jenkins-bot:

[design/codex@main] build, tokens, styles: Introduce simple stylesheet unit transform

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

Test wiki on Patch demo by ATomasevich (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/71dd00c269/w/

Sarai-WMDE updated the task description. (Show Details)
Sarai-WMDE added a subscriber: bmartinezcalvo.

Change 869852 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v0.4.3 to v0.5.0

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

Change 885450 had a related patch set uploaded (by Catrope; author: Catrope):

[mediawiki/core@master] Update Codex from v0.4.3 to v0.5.0

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

Change 885450 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v0.4.3 to v0.5.0

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

Design sign-off done. Thumbnails resize correctly in relation to the browser font size in all contexts (MenuItem, Card, TypeaheadSearch). No "visual regressions" were found via manual testing.

Test scope: Firefox v109, Chrome v109 and Safari v15.6 on macOS Monterey (12.5.1).

egardner subscribed.

Confirming that this works correctly in Vector and has been released to production.