Page MenuHomePhabricator

Large whitespace between content and categories on Commons file pages
Closed, ResolvedPublicBUG REPORT

Description

When you visit any file on Wikimedia Commons:

https://commons.wikimedia.org/wiki/File:1581_Bunting_clover_leaf_map.jpg

or

https://commons.wikimedia.org/wiki/File:Bronis%C5%82aw_Opa%C5%82ko_statue.jpg

What happens?:

Screenshot 2023-05-29 at 9.55.17 AM.png (2×4 px, 1 MB)
Screenshot 2023-05-29 at 9.54.51 AM.png (2×4 px, 1 MB)

There is white space between content and categories.
No matter what the size of the content the space is always there.

It's because of this CSS:

.wbmi-tabs-container .wbmi-tab, .wbmi-tabs-container .wbmi-tab.oo-ui-panelLayout {
    margin: 1rem 0;
    padding: 0;
    min-height: 37em;
}

(min-height)

from file: https://commons.wikimedia.org/w/load.php?lang=en&modules=ext.echo.styles.badge%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cfilepage%7Cjquery.makeCollapsible.styles%7Cmediawiki.action.view.filepage%7Cmediawiki.interface.helpers.styles%7Cmediawiki.ui.button%2Cicon%7Coojs-ui.styles.icons-alerts%7Cskins.vector.icons%2Cstyles%7Cwikibase.alltargets%7Cwikibase.mediainfo.filepage.styles%7Cwikibase.mediainfo.statements.styles&only=styles&skin=vector-2022

What should have happened instead?: There should be no dead space on the page, it looks odd.

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

Other information (browser name/version, screenshots, etc.):
Google Chrome 113, Fedora GNU/Linux 37

https://jcubic.pl/commons-dead-space.png

Event Timeline

@Jcubic hi, thanks for filing this bug. The CSS you point to lives in the WikibaseMediaInfo extension in the mediainfo-filepage.less file. Since I can see this whitespace on both legacy Vector and Vector 2022, I don't think it's related to #desktop_improvements_vector_2022.

Aklapper renamed this task from Commons have wrong CSS on single file page to Large whitespace between content and categories on Commons file pages.May 30 2023, 5:31 PM
Aklapper added a project: CSS.

I got these spaces too, and the same if using safemode, also with both legacy Vector and Vector 2022 - but also under the tab Structured Data.

It's caused by the changes to how inactive tabs are hidden in OOUI v0.47.0 (https://gerrit.wikimedia.org/r/c/oojs/ui/+/894065). The min-height defined here: https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseMediaInfo/+/b0acfdc8e058f881be6ee46bda873ee252e1070a/resources/filepage/styles/mediainfo-filepage.less#38 now applies even to tabs that are hidden, causing the blank space to appear.

The simplest fix is probably to change the selector:

	.wbmi-tab,
	.wbmi-tab.oo-ui-panelLayout

…to this:

	.wbmi-tab.oo-ui-tabPanelLayout-active

Change 924980 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/WikibaseMediaInfo@master] Update tab panel styles to avoid targetting hidden panels

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

Change 924980 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] Update tab panel styles to avoid targetting hidden panels

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

matmarex assigned this task to Esanders.

This change will be deployed to Wikimedia wikis next week, per the usual schedule.