Page MenuHomePhabricator

[MEX] M4- highlight preferred rank in green
Open, Needs TriagePublic

Description

As a user, i want to see the preferred statements highlighted in green, so i know which statements are more valid.

AC

  • Preferred rank statements get highlighted in green
  • Deprecated rank get highlighted in red
  • The green/red colors are the same as in desktop (refer to the un/success pop ups)

Event Timeline

Note: In the desktop UI, this isn’t part of Wikibase itself – Wikibase only marks the statement elements with a class (wb-preferred, wb-deprecated) which is then styled via MediaWiki:common.css. My expectation would be that we do the same thing in wbui2025 / MEX: add some useful class (possibly with the same name, but perhaps not) to some element on the statement, then leave the actual background color to site styles.

See also: T198907: Visually distinguish deprecated statements in Wikidata UI

hoo moved this task from The Backlog to The Board on the Wikidata-Omega board.
hoo edited projects, added Wikidata-Omega (The Board); removed Wikidata-Omega.
hoo moved this task from new to the board to In Development on the Wikidata-Omega (The Board) board.
karapayneWMDE renamed this task from [MEX] highlight preferred rank in green to [MEX] M4- highlight preferred rank in green.Tue, Feb 10, 4:49 PM

Change #1239209 had a related patch set uploaded (by Hoo man; author: Hoo man):

[mediawiki/extensions/Wikibase@master] MEX: Set wb-preferred, wb-deprecated classes in statementView

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

hoo removed hoo as the assignee of this task.Thu, Feb 12, 7:35 PM
hoo subscribed.

This works nicely with:

.wb-deprecated .wikibase-statementview-mainsnak, .wb-deprecated .wikibase-wbui2025-main-snak {
	 /* red-ish background for deprecated statements */
	background-color: var(--background-color-destructive-subtle,#fee7e6);
	color: var(--color-base,#202122);
}
.wb-preferred .wikibase-statementview-mainsnak, .wb-preferred .wikibase-wbui2025-main-snak {
	/* green-ish background for preferred statements  */
	background-color: var(--background-color-success-subtle,#d5fdf4);
	color: var(--color-base,#202122);
}

@hoo Can you explain for product-verification purposes how users can configure this? I tested this by changing the MEX CSS, but that obviously won't work for beta / test / prod.

Change #1239209 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] MEX: Set wb-preferred, wb-deprecated classes in statementView

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

@hoo Can you explain for product-verification purposes how users can configure this? I tested this by changing the MEX CSS, but that obviously won't work for beta / test / prod.

Put the above (T416197#11612589) code into your wiki's MediaWiki:Common.css.