Page MenuHomePhabricator

[SPIKE] Audit places in VE that depend on skin font size
Closed, ResolvedPublic

Assigned To
Authored By
ppelberg
Aug 18 2022, 6:25 PM
Referenced Files
F35477292: image.png
Aug 18 2022, 9:22 PM
F35477289: image.png
Aug 18 2022, 9:22 PM
F35477211: image.png
Aug 18 2022, 9:22 PM
F35477196: image.png
Aug 18 2022, 9:22 PM
F35477194: image.png
Aug 18 2022, 9:22 PM
F35477188: image.png
Aug 18 2022, 9:22 PM
F35477179: image.png
Aug 18 2022, 9:22 PM
F35477202: image.png
Aug 18 2022, 9:22 PM
Tokens
"Mountain of Wealth" token, awarded by Jdlrobson.

Description

In T313828, the Web Team is working to create consistency among the various small font sizes in the Vector (2022) skin.

This task involves the work of the Editing Team investigating where – if at all – within the VE codebase "transformations" are applied to the font size(s) the skin provides VE.

Knowing the above will help the Editing and Web Teams avoid any regressions T313828 could introduce.

Done

  • The Editing Team shares where – if at all – VE is applying transformations to the font sizes the Vector 2022 is providing it

Event Timeline

Changing most of the elements with "small" font sizes in that task should not affect VE at all.

If you change the heading font sizes, you should also update https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/master/modules/ve-mw/ui/styles/tools/ve.ui.MWFormatTool-vector.css – this file defines the styles for the "Format paragraph" menu. (It doesn't use normal <h2> elements etc. to avoid affecting accessibility, and because some styles like the underlines are undesirable.)

image.png (2×3 px, 1 MB)

If you want to change the base font size (T254055), you're signing up for a long journey.


Two important notes before I start:

  • What really is the base font size? You should decide first of all whether you're changing just the content font size, or also the interface font size for all of the toolbars, menus and dialogs. They don't have to be the same, but they should probably be close. (You can look at MonoBook as an example, where for reasons lost to history, the content font-size is 12.7px but the interface font-size is 12.8px.) Note that while VisualEditor can support different content and interface font sizes, most other tools I know of do not consider that, and you'll end up with different font sizes on a button depending on whether it's shown in a dialog or not.
  • Most of the editor interface uses em for sizing, so it will adjust to any font size (try using the editor in Vector, MonoBook and desktop Minerva to see). However, this also means that the right font size must also be set on elements that don't contain any visible text, like toolbar icon buttons.

Once you know what your font sizes are supposed to be, you can start making changes and checking if things look correctly. Test the following: [see gallery below]

  • Content in the main editor (we call it the "target"), as well as in visual diff and 2017 wikitext editor preview, must have the content font (check font-size and line-height)
  • Content in the main editor when using 2017 wikitext editor, as well as in wikitext diff, must have the wikitext editor font – this differs depending on user preferences
  • All interface elements: toolbar (including dropdown menus and toolbar dialogs), context menus, inspectors and dialogs (including popups that extend outside the dialog) must have the interface font (check font-size and line-height, and check that any icons are aligned to pixel grid)
  • Content in small editors inside dialogs (we call them "target widgets") must have the content font again (check line-height in particular, these can be multi-line with longer text, and we had problems getting this right in the past)
  • All interface elements in those small editors must have the interface font
  • And so on all the way down, as the small editors can be nested – consider e.g. a template in a reference in an image caption, which would have three "layers" of dialogs and editors
  • The small editors can also be used outside of the main editor – test all of the above (including nested dialogs) with the DiscussionTools reply or new topic tool as well

To ensure all of the above works correctly, in every skin, we use CSS classes with skin-defined styles like mw-body-content, and also have some skin-specific style overrides: https://github.com/search?q=repo%3Awikimedia%2Fmediawiki-extensions-VisualEditor+filename%3A*vector*&type=Code&ref=advsearch&l=&l= (many of the hacks are necessary because Vector uses its own custom CSS classes, instead of the de facto standard ones that every other skin uses – see e.g. T287733, T313221).

Random page for testing: https://en.wikipedia.org/wiki/Platystoma_lugubre

View modeimage.png (2×3 px, 1 MB)
Content in the main editorimage.png (2×3 px, 1 MB)
Content in visual diffimage.png (2×3 px, 1 MB)
Content in wikitext diff (uses wikitext editor font)image.png (2×3 px, 1 MB)
Interface: toolbarimage.png (2×3 px, 1 MB)
Interface: toolbar dropdown menuimage.png (2×3 px, 1 MB) image.png (2×3 px, 1 MB)
Interface: toolbar dialogimage.png (2×3 px, 1 MB)
Interface: context menuimage.png (2×3 px, 1 MB) image.png (2×3 px, 1 MB) image.png (2×3 px, 1 MB)
Interface: inspectorimage.png (2×3 px, 1 MB)
Interface: dialogimage.png (2×3 px, 1 MB) image.png (2×3 px, 1 MB)
Interface: dialog popup that extends outside the dialogimage.png (2×3 px, 1 MB)
Content in small editorimage.png (2×3 px, 1 MB)
Interface in small editor: toolbarimage.png (2×3 px, 1 MB)
Interface in small editor: toolbar dropdown menuimage.png (2×3 px, 1 MB)
Interface in small editor: toolbar dialogimage.png (2×3 px, 1 MB)
Interface in small editor: context menuimage.png (2×3 px, 1 MB) image.png (2×3 px, 1 MB)
Interface in small editor: inspectorimage.png (2×3 px, 1 MB) (oops… the line height on the title is broken!) → filed T315618
Interface in small editor: dialogimage.png (2×3 px, 883 KB)
Nested dialog for a template in a reference in an image captionimage.png (2×3 px, 888 KB) image.png (2×3 px, 661 KB)
DiscussionTools new topic toolimage.png (2×3 px, 452 KB)
DiscussionTools new topic tool inspectorimage.png (2×3 px, 436 KB)
DiscussionTools new topic tool dialogimage.png (2×3 px, 315 KB)
ppelberg reopened this task as Open.
ppelberg claimed this task.