Page MenuHomePhabricator

Using the Vector (2022) theme in conjunction with the realtime preview beta feature makes the font size of the live preview too large.
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
InsaneHacker
Nov 3 2022, 3:30 PM

Description

Steps to replicate the issue (include links if applicable):
(Bug experienced on the Danish Wikipedia โ€“ I have not tested it elsewhere)

  • Enable the "Realtime preview" beta feature.
  • Enable Vector (2022) as your theme.
  • Edit any page (I've tested this in article space and the Wikipedia-namespace).
  • Enable the live preview.

What happens?:
The live preview renders the article with a font size roughly 125-150% larger than the article font actually is when reading it normally, or when using the live preview feature on the Vector (2010) theme.

An example can be seen at this link: https://imgur.com/a/8OQ2dcg. The top text is how the article text is rendered using the normal preview feature, and is also how the text appears when using the live preview in conjunction with the Vector (2010) theme. The text on the left is the wikitext window, and the text on the right is the live preview as it appears on the Vector (2022) theme, where the text is noticeably bigger than it should be. Compare https://imgur.com/a/rI99tG4, which was taken using Vector (2010). Here the text size is the same between the old school preview and the live preview.

What should have happened instead?:
The live preview should be rendered the same way as it appears when using Vector (2010), as this is a true preview of how the article will look when saved, and presumably also the intended outcome.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
I'm using Firefox 106.0.3 (64-bit)
Screenshots are linked above

(Reuploaded here)

image.png (805ร—1 px, 293 KB)
(8OQ2dcg)

image.png (659ร—1 px, 284 KB)
(rI99tG4)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptNov 3 2022, 3:30 PM

@TheresNoTime Since you stated that there might be a relation between this issue and T321728, I just wanted to inform you that I just noticed that I am experiencing the same problem as reported in the below quote. However, I am still not experiencing an increased font size in the "old school" preview which is the main issue at that page.

@Iniquity It doesn't just increase the preview font size. "This" change caused also the enlargement of all elements of the toolbox and the editor itself on pl wikisoource....

image.png (691ร—1 px, 122 KB)

image.png (590ร—1 px, 197 KB)

It looks like a "side effect" of T312963...

Confirmed on en.wikipedia.beta:

image.png (328ร—1 px, 44 KB)

Manually negating out the inline defined

.vector-body {
	font-size: 100%;
}

lets the more reasonable

.vector-body {
	font-size: 0.875em;
	font-size: calc(1em * 0.875);
	line-height: 1.6;
}

apply, resulting in:

image.png (350ร—1 px, 41 KB)

Turning off "Enable responsive mode" resolves this for me โ€” @InsaneHacker can you confirm? If you turn off "Enable responsive mode" in your Special:Preferences, does the text size look the same? (for me it's 13px for the edit window, and 14px for the realtime preview)

Turning off "Enable responsive mode" resolves this for me โ€” @InsaneHacker can you confirm? If you turn off "Enable responsive mode" in your Special:Preferences, does the text size look the same? (for me it's 13px for the edit window, and 14px for the realtime preview)

Not 'Enable limited width mode'? Because turning this setting off fixed this behavior :)

Oh, wrong task, sorry, this comment for T321728.

Turning off "Enable responsive mode" resolves this for me โ€” @InsaneHacker can you confirm? If you turn off "Enable responsive mode" in your Special:Preferences, does the text size look the same? (for me it's 13px for the edit window, and 14px for the realtime preview)

Unfortunately not :-( โ€“ I tried turning off responsive mode, which didn't change anything. I then logged in via a Private Browsing window just in case there was some caching issue, but the text was still too large. I then experimented with turning off both responsive mode and limited width mode, turning both off, or just having one of either on, but I don't see any changes.

It looks like this in all cases:

billede.png (856ร—1 px, 118 KB)

Turning off "Enable responsive mode" resolves this for me โ€” @InsaneHacker can you confirm? If you turn off "Enable responsive mode" in your Special:Preferences, does the text size look the same? (for me it's 13px for the edit window, and 14px for the realtime preview)

Unfortunately not :-( โ€“ I tried turning off responsive mode, which didn't change anything. I then logged in via a Private Browsing window just in case there was some caching issue, but the text was still too large. I then experimented with turning off both responsive mode and limited width mode, turning both off, or just having one of either on, but I don't see any changes.

On further investigation, that may have been me forgetting to turn off a style override โ€” sorry, please ignore that bit of advice!

I've narrowed it down to this line (commenting that out does resolve it), but that was added by @Samwilson for a good reason.. hmm..

Change 853060 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/skins/Vector@master] skinStyles: Move mw-parser-output out of more specific selector

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

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

Should probably split this out into it's own task, but I don't think previews are meant to look like this with the "Enable limited width mode" toggle unchecked...

image.png (785ร—1 px, 97 KB)

Should probably split this out into it's own task, but I don't think previews are meant to look like this with the "Enable limited width mode" toggle unchecked...

It looks like the behaviour is actually inverted: when the pref is off the width is narrow, but when it's on then the preview is full-width. I've created T322385 for it.

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

https://patchdemo.wmflabs.org/wikis/21bb3fe9d6/w/

Change 853060 merged by jenkins-bot:

[mediawiki/skins/Vector@master] skinStyles: Move mw-parser-output out of more specific selector

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

it looks like the preview will indeed return to normal font size after this change, but the edit page descriptions, the toolbox and other elements are still displayed in the enlarged font size:

image.png (873ร—1 px, 156 KB)

I've been experimenting with this, but can't seem to figure out how to ensure that #wikiPreview maintains font-size:100% (so its width matches the content width when not editing), while also keeping all other text within .vector-body at the smaller size.

Here's a striped-down example that tries to replicate the structure: https://codepen.io/freosam/pen/poKEGNo

dom_walden subscribed.
Enable limited width modeReadingEditingNormal previewLive preview
On
Screenshot 2022-11-09 at 14-20-18 Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free encyclopedia.png (973ร—1 px, 96 KB)
width: 960px
Screenshot 2022-11-09 at 14-21-43 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 184 KB)
width 1492px (without left-hand menu open), 1200px (with left-hand menu open)
Screenshot 2022-11-09 at 14-22-40 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 226 KB)
width: 960px
Screenshot 2022-11-09 at 14-23-51 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 213 KB)
width: 1492px (without left-hand menu open), 1200px (with left-hand menu open)
Off
Screenshot 2022-11-09 at 14-25-17 Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free encyclopedia.png (973ร—1 px, 90 KB)
width: 1802px (without TOC or left-hand menu), 1510px (with TOC or left-hand menu)
Screenshot 2022-11-09 at 14-25-55 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 171 KB)
width: 1802px (without left-hand menu), 1510px (with left-hand menu)
Screenshot 2022-11-09 at 14-26-42 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 198 KB)
width of content: 960px (with and without TOC or left-hand menu); width of WikiEditor: 1802px (without TOC or left-hand menu), 1510px (with TOC or left-hand menu)
Screenshot 2022-11-09 at 14-27-31 Editing Echo test page 261028837830933529120419539143114769919 - Wikipedia, the free ency[...].png (1ร—1 px, 198 KB)
width of content: 960px (with and without TOC or left-hand menu); width of WikiEditor: 1802px (without TOC or left-hand menu), 1510px (with TOC or left-hand menu)

All the above was tested at 100% zoom and Firefox's default font size setting (16px).

The font size of the article's content was always 14px. Other elements on the page were 16px (raised as T322738).

Test environment: https://en.wikipedia.beta.wmflabs.org MediaWiki 1.40.0-alpha (02a97c8) 10:21, 9 November 2022. Vector 1.0.0 (32230c1) 08:01, 9 November 2022. WikiEditor 0.5.3 (c621738) 07:59, 9 November 2022.
Test browser: Firefox 91.

@Samwilson , @dom_walden @TheresNoTime
After the change introduced here, the preview (in the vector-2022 skin) reverted to the standard font size in the main space,
but on Wikisource in the "Page" NS it made that (in the preview) unfortunately the font size is too small(!) (
(left view; right: preview):

image.png (683ร—1 px, 355 KB)

https://pl.wikisource.org/w/index.php?title=Page:Wac%C5%82aw_Niezabitowski_-_Ostatni_na_ziemi.djvu/66&action=submit

much smaller than before the font enlargement that this change was supposed to eliminate :(

This makes it very difficult to work on WS

@Samwilson , @dom_walden @TheresNoTime
After the change introduced here, the preview (in the vector-2022 skin) reverted to the standard font size in the main space,
but on Wikisource in the "Page" NS it made that (in the preview) unfortunately the font size is too small(!) (

Thanks for raising this. I think the problem is it has two nested <div class="mw-parser-output">, which means font-size: 0.875em is applied twice.

I raised T323751.