Page MenuHomePhabricator

Inline diff toggle label spans multiple lines if the text has more than one word
Closed, ResolvedPublicBUG REPORT

Description

If the label of the inline diff toggle (diff-inline-format-label) has more than one word, then the label will span multiple lines, see screenshot from this page:

image.png (432×1 px, 62 KB)

This looks off because the label and the toggle are not vertically aligned, and it adds 16px of vertical spacing to the whole header.

See list of affected languages.

QA Results - Prod Wiki

Event Timeline

MusikAnimal changed the subtype of this task from "Task" to "Bug Report".

Thanks so much for reporting this! I'm surprised this got as far as it did without further complaint.

A particularly glaring example in Croatian:

Screenshot from 2023-10-19 22-58-25.png (388×1 px, 69 KB)

Patch incoming for:

Screenshot from 2023-10-19 23-10-32.png (321×1 px, 67 KB)

And on really small screens (not that the UI was designed for this in the first place):

Screenshot from 2023-10-19 23-27-33.png (429×770 px, 59 KB)

cc @JSengupta-WMF to make sure this is fine. Alternatively, we can retain the word wrapping (default behaviour) and just keep the toggle vertically/right aligned, but it may require a flexbox guru (not me!) to figure it out.

We should also add instruction in the i18n documentation telling translators to use brevity. I actually wonder if some of these translations are verbose solely to better explain what the toggle does; perhaps now that T346429 is done this will be less of a concern.

Change 967994 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] diffs: vertically align inline toggle and make text nowrap

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

Joy is out until November 3. The above patch can hold us off until we get designer sign-off. Then again, this has been broken since we launched better diffs, and no apart from this task has complained... so maybe it isn't so urgent.

Change 967994 merged by jenkins-bot:

[mediawiki/core@master] diffs: vertically align inline toggle and make text nowrap

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

@MusikAnimal Label and the toggle are vertically aligned for all languages tested from https://codesearch.wmcloud.org/core/?q=diff-inline-format-label%22%3A+%22%5B%5E%22%5D%2B%5B+%5D&files=&excludeFiles=&repos=. I will move this to Done. Thanks for all your work!

Status: ✅PASS
Environment: Prod Wiki (Multi-Languages)
OS: macOS Sonoma 14.0
Browser: Chrome 117, Firefox 118, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://it.wikipedia.org/w/index.php?title=Utente:Daimona_Eaytoy/Sandbox&curid=6272332&diff=135486924&oldid=135486909&uselang=it
https://codesearch.wmcloud.org/core/?q=diff-inline-format-label%22%3A+%22%5B%5E%22%5D%2B%5B+%5D&files=&excludeFiles=&repos=

✅AC1: https://phabricator.wikimedia.org/T346476

Small ScreenZoomChromeFirefoxSafariDifferent Skin
2023-10-25_13-43-53.png (1×584 px, 147 KB)
2023-10-25_13-45-46.png (1×800 px, 182 KB)
2023-10-25_13-10-39.png (1×3 px, 375 KB)
2023-10-25_13-10-01.png (1×2 px, 341 KB)
2023-10-25_13-49-13.png (1×729 px, 230 KB)
2023-10-25_13-35-04.png (1×1 px, 271 KB)

@MusikAnimal Is it possible to show the toggle on the next line when the screen size is too small or the text length is too long? Something like this

Screenshot 2023-11-02 at 09.36.45.png (636×1 px, 342 KB)

FYI still on leave followed by the P+T leadership so responses maybe delayed.