Page MenuHomePhabricator

Wikidata Vector 2022 sticky header covers sticky property name for properties with many values
Closed, ResolvedPublicBUG REPORT

Description

In Wikidata, property names on items stick to the top of their container, so when you scroll down, the property name is still visible when the list of statements for that property is long.

To reproduce:

What happens:

  • The property name is not visible, because it is sticky behind the sticky header

What should happen:

Before scroll, no problem:

image.png (1,181×512 px, 35 KB)

After scroll, property name covered:
image.png (1,138×390 px, 28 KB)

Event Timeline

jhsoby subscribed.

Sorry, I think I misunderstood the problem here. They're similar, but not the same.

Change #1196876 had a related patch set uploaded (by Jon Harald Søby; author: Jon Harald Søby):

[mediawiki/extensions/Wikibase@master] Display sticky property labels below sticky headers

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

I don’t get the sticky header locally (despite being logged in – it looks similar but doesn’t behave sticky); do I need to do something to get it?

Ah, stickyHeader.js has a hard-coded list of namespaces where sticky headers are enabled, and my wiki’s Item namespace isn’t one of them.

function isAllowedNamespace( namespaceNumber ) {
	// Corresponds to Main, User, Wikipedia, Template, Help, Category, Portal, Module.                                                                                                                                                                                                                                                                                                        
	const allowedNamespaceNumbers = [ 0, 2, 4, 10, 12, 14, 100, 828 ];
	// Also allow on all talk namespaces (compare NamespaceInfo::isTalk()).                                                                                                                                                                                                                                                                                                                   
	const isAllowedTalk = namespaceNumber > 0 && namespaceNumber % 2 !== 0;
	return isAllowedTalk || allowedNamespaceNumbers.includes( namespaceNumber );
}

Leaving a code review comment here because I can’t attach images on Gerrit:

PS2 changed the top from calc( 3.125rem + 10px ); to just 3.125rem + 10px; – but I think the calc() is necessary after all. On PS2, I get an absurd amount of whitespace:

image.png (406×449 px, 12 KB)

And the dev tools say that it has top: 13.125rem; – so I guess Less just added the 10 to the 3.125rem ignoring the px unit. (Might be a Less.php-specific bug? But might also be “garbage in, garbage out” – as far as I’m aware 3.125rem + 10px isn’t valid CSS, so it wouldn’t really work better if Less hadn’t done the addition.)
With the calc(), it looks better:
image.png (409×309 px, 11 KB)

Change #1196876 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Display sticky property labels below sticky headers

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

Thanks for the review, @Lucas_Werkmeister_WMDE! Should I just close this task now, or should we wait for deployment and/or testing?