Page MenuHomePhabricator

WikidataPagebanner shrunk due to Desktop improvements
Closed, ResolvedPublic0 Estimated Story PointsBUG REPORT

Description

Original report: https://en.wikivoyage.org/wiki/Wikivoyage:Travellers%27_pub#Shrunk_banners

Steps to replicate the issue (include links if applicable):

What happens?:

Bug 1, for all users: There is a lot of space before the banner.

Bug 2, for all users: The items in de ToC are pretty small and hard to read

Bug 3, for Safari users. The banner seems to be only 20% of the required height

All of this has to do with modifications that desktop improvements has made.

Causes

Bug 1: The vector-body-before-content is a display:block uses overflow:hidden, to create a new block formatting context, which negates the floate of the mw-indicators, which normally would take up 0 height and thus pushes the banner down.

Bug 2: The font-size of contentSub is overridden from 100% to 84% by specificity increase due to zebra-feature wrapping.

Bug 3: The font-size change somehow seems to trigger a subpixel sizing bug in Safari. The width of the image is set to 100% and height to auto, yet with the font size change, it seems that when the responsive sizing applies, it incorrectly pixel rounds the image dimensions. A height of say 126 pixels, becomes 126.24px when that font-size option is set. This causes the image to be larger than its container (this should not be possible, it's clearly a safari bug). Because the image is bigger than the container, it then triggers portrait detection, which in turn sets a margin-top, that causes half the picture to become way to small vertically.

Screenshots
Original Vector:

Screenshot 2023-05-09 at 15.45.19.jpg (1×3 px, 1 MB)

Vector 2022 Chrome:
Screenshot 2023-05-09 at 15.44.12.png (684×1 px, 1 MB)

Vector 2022 Safari:
Screenshot 2023-05-09 at 15.43.45.png (532×1 px, 424 KB)

QA Results - Beta

ACStatusDetails
1T336264#8857193

QA Results - Prod

ACStatusDetails
1T336264#8871416

Event Timeline

  1. It seems that voyage actually has a override to font-size: 100%, but due to increased specificity of the the vector-2022 styling rule for 84%, it is no longer applying
  2. This might not be 'just' the font-size triggering. It seems that multiple things that influence the eventual effective size of the element actually do. The best way to fix this, seems to be to have the container of the image set "height: auto", but not set height: auto on the img itself. That means the container height can just adapt to the image height, without the height of the image being 'wrong' overriding the logic.

https://en.wikivoyage.org/wiki/User:TheDJ/common.css fixes most issues

  1. is because mw-indicators are now inside a parent in vector-2022. This probably should just be overridden in each Wikivoyage site that uses page banners
  2. this seems mostly because of the zebra wrapping of contentsub, which makes the specificity of MediaWiki:Vector.css not enough (Also, that page should be copied to 2022).
  3. It seems that the font-size does increase the likelihood of triggering this SOOO much that if you restore the font-size, you almost never seem to trigger the bug again

I also cleaned up the indenting of the page banner, which seems unnecessary and is a side effect of its usage of the subtitle. This should be moved into PageBanner extension perhaps, or maybe the page banner should not be using the page-subtitle to begin with. We might have cleaner entry points for adding this content now ? ....

https://en.wikivoyage.org/wiki/MediaWiki_talk:Common.js#GPX_visibility

Part of this seems related to T316830: [M] Gadgets should have a reliable way to add content to the subtitle I60eb3c7d7f169be2f826d7dc3948de5203e5f303 which deprecated #contentSub and #contentSub2 in favor of #mw-content-subtitle. The follow up for that transition seems to not have taken place.

Change 919222 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/WikidataPageBanner@master] Fix indent overrides made on #contentSub

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

Change 919232 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/WikidataPageBanner@master] Fix Safari bug with responsive image sizing

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

hmm. there is something strange going on with mw-content-subtitle, other than it seemingly being an incomplete migration... For instance MW core styles it as a class, but it is actually an ID...

hmm. there is something strange going on with mw-content-subtitle, other than it seemingly being an incomplete migration... For instance MW core styles it as a class, but it is actually an ID...

Yep looks like I added the wrong selector and forgot to cleanup after myself :) https://gerrit.wikimedia.org/r/c/mediawiki/core/+/919241

Change 919222 merged by jenkins-bot:

[mediawiki/extensions/WikidataPageBanner@master] Fix indent overrides made on #contentSub

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

Change 919232 merged by jenkins-bot:

[mediawiki/extensions/WikidataPageBanner@master] Fix Safari bug with responsive image sizing

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

Jdlrobson set the point value for this task to 0.

Edward could you take a look at this on the beta cluster? https://en.wikivoyage.beta.wmflabs.org/wiki/Bannerda Thanks in advance!

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Ventura
Browser: Chrome, Safari
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Wikidatapagebanner should not be shrunken

Screenshot 2023-05-16 at 9.33.10 AM.png (943×1 px, 463 KB)

Screenshot 2023-05-16 at 9.33.04 AM.png (955×1 px, 451 KB)

Edtadros removed Edtadros as the assignee of this task.

Test Result - Beta

Status: ✅ PASS
Environment: frwiki
OS: macOS Ventura
Browser: Chrome, Safari
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: Wikidatapagebanner should not be shrunken

Screenshot 2023-05-22 at 9.21.46 AM.png (610×1 px, 592 KB)

Screenshot 2023-05-22 at 9.20.22 AM.png (610×1 px, 586 KB)