Page MenuHomePhabricator

Make Wikidata desktop site more responsive/mobile-friendly
Open, Needs TriagePublic

Description

People often need to use the desktop site on mobile devices, e.g. because it's not possible to edit statements on the mobile site (see T95878), because Wikimedia's mobile sites are missing most of the links available on the desktop sites, because most gadgets are not designed for Minerva, etc.

Wikidata's CSS currently contains things which make the desktop site very difficult to use on narrower screens. Some adjustments, e.g. to use media queries to selectively apply styles, could make the desktop site much better on narrower screens.

Some specific issues:

  1. The sitelink sections are a fixed width, which causes horizontal scrolling
  2. The property labels take up a lot of horizontal space
  3. The edit toolbars are a fixed width, which causes the statement values/input fields to be too narrow
  4. The sidebar can't be hidden in the Vector skin, which takes up a lot of horizontal space
  5. The Vector and Vector 2022 skins are not responsive/mobile-friendly, which causes the page to be zoomed out

1:

.wikibase-sitelinkgroupview currently has width: 30em. Changing that to the following seems to behave the same on wider screens while not causing horizontal scrolling on narrower screens:

.wikibase-sitelinkgroupview {
	max-width: 30em;
	width: 100%;
}

2 and 3:

Property labels could be shown above the list of statements (similar to what the mobile site does) when the page width is below a certain width.

The rest of the statement section could use media queries and/or CSS grids to adjust the layout.

Examples:

The first section of https://www.wikidata.org/wiki/User:Nikki/narrow.css has some CSS to display the property labels above the list of statements, the third section adjusts the layout of statements to be more usable (although not very pretty) on a narrower screen.

It's not designed for narrower screens but CSS grids are also used by https://www.wikidata.org/wiki/MediaWiki:Gadget-compact_items.css (the grid styles are in https://www.wikidata.org/wiki/MediaWiki:Gadget-gridify.css)

4 and 5:

Minerva, Timeless and Monobook all already work fine and Vector 2022 explicitly does not support narrower screens (link), so the following is specific to Vector:

  • Adding <meta name="viewport" content="width=device-width, initial-scale=1"> would stop it from zooming out by default.
  • A sidebar toggle could be added. The Translate extension already has one (see Special:Translate) which could be reused or adapted.
  • Making the sidebar overlay the content (by removing the margin which is reserved for it) would make the menus/tabs display better.
  • The "Read" tab could be hidden to save space, since it's the same as the first tab.

Example: https://www.wikidata.org/wiki/User:Nikki/VectorMobile.js (which also loads https://www.wikidata.org/wiki/User:Nikki/VectorMobile.css)

This could be changed using a gadget specific to Wikidata or changed in the Wikibase extension (like the Translate extension does) so other Wikibases can benefit too.

Event Timeline

Here's a more complete stylesheet/script I've been working on based on my original prototype (with screenshots): https://www.wikidata.org/wiki/User:Nikki/NarrowUI

Change 973338 had a related patch set uploaded (by Nikki; author: Nikki):

[mediawiki/extensions/Wikibase@master] Adjust styling for sitelink groups to avoid horizontal scrolling

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

Change 973338 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Adjust styling for sitelink groups to avoid horizontal scrolling

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

Is this task the parent or child of T259183?

Change 985393 had a related patch set uploaded (by Nikki; author: Nikki):

[mediawiki/extensions/Wikibase@master] Adjust box-sizing for headings on entity pages

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

Is this task the parent or child of T259183?

I think that ticket is a subtask of this one. This one includes more than just statements.

Change 985393 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Adjust box-sizing for headings on entity pages

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

Here's a more complete stylesheet/script I've been working on based on my original prototype (with screenshots): https://www.wikidata.org/wiki/User:Nikki/NarrowUI

I've turned this into a gadget (actually two) now so people can enable it in their preferences.

I also split the CSS up:

Change #1017480 had a related patch set uploaded (by Nikki; author: Nikki):

[mediawiki/extensions/Wikibase@master] Set a minimum width for values in statements

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

Unfortunately, it looks like the change in the patch https://gerrit.wikimedia.org/r/1017480, which applies a min-width to mainsnak values, cannot be applied as a fix in isolation. The solution causes the values to overlap with the edit options in narrower screens. We could consider using flex-box in this context to ensure that the content remains as readable as possible, and that proper spacing between elements is maintained. Aligning the toolbar and its actions to the end (right for LTR UIs) of the mainsnak might be of help here too. All in all, the issue should be addressed more comprehensively (there might be chained decisions to make and different scenarios to observe). For that reason, I'd say design support would be needed in this instance.

Screenshot 2024-04-09 at 18.30.21.png (774×1 px, 71 KB)

During Wikimedia Wishathon, @Rtnf shared the vision for Wikidata to function similarly to how Every Door supports data entry on mobile phones: https://every-door.app/. They showcased a prototype, a mobile-friendly Wikidata web view using the Wikibase API to search for and navigate related Wikidata items. Demo links are here:

https://meta.wikimedia.org/wiki/Community_Tech/Wishathon/March_2024/Adding_statements_on_mobile_devices

Change #1079571 had a related patch set uploaded (by Agabi10; author: Agabi10):

[mediawiki/extensions/Wikibase@master] Use full width for references

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

I changed the CSS of the references to make them more readable on narrow screens at least when the user is out of the edit mode.

BeforeAfter
wd-before.png (844×1 px, 29 KB)
wd-after.png (406×1 px, 33 KB)

When changing to edit mode it still keeps the old margin to prevent overlaping with the remove buttons.

Change #1079594 had a related patch set uploaded (by Agabi10; author: Agabi10):

[mediawiki/extensions/Wikibase@master] Move property box to the top on narrow screens

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

Change #1079597 had a related patch set uploaded (by Agabi10; author: Agabi10):

[mediawiki/extensions/WikibaseQualityConstraints@master] Increase z-index to prevent overlapping

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

@Lucas_Werkmeister_WMDE do you have any idea when will be possible having the design review that's pending for the patches? They might not be the perfect solution, but they really improve the current situation in which the entity pages are completely broken in narrow screens.