Page MenuHomePhabricator

In Special:MessageGroupStats, color of "Published" doesn’t return to green after hover
Closed, ResolvedPublic

Description

On Special:MessageGroupStats, the default color of the state "Published" is green (#AEA), it changes to white on hover mouse event, but it become gray (#AFAFAF) when the mouse leaves; contrary to other states, which return to their previous color. Tested on Opera 12.16, Firefox 38.0.1, Chromium 31.0.1650.63, and Opera 30.0.1835.59.

Example: https://meta.wikimedia.org/wiki/Special:MessageGroupStats?group=page-Tech%2FNews%2F2015%2F25

I propose to reuse the same original green when the mouse leaves a "Published" state to be consistent with behaviour of other states (I doubt the current behaviour is intentional, at least I find it weird).

I didn’t dive into the Translate code for now but I guess it would be easy to fix since it should be the same behaviour as other states. I guess this issue badly behaves with the wikitable CSS style.

Event Timeline

Seb35 created this task.Jun 27 2015, 7:53 AM
Seb35 raised the priority of this task from to Low.
Seb35 updated the task description. (Show Details)
Seb35 added a subscriber: Seb35.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 27 2015, 7:53 AM
Seb35 added a comment.Jul 14 2015, 8:46 PM

Explanation of the bug: When the mouse hovers a line, it is added 0.3 to the saturation (in the HSL color space), but the HSL value of #AAEEAA is (120°, 0.66, 0.8).

So when you add 0.3 to 0.8 the value 1.1 is above the maximum value (1.0), you get RGB=(297,263,297) even if the maximum values are 255, and then the browser changes this incorrect value to the nearest (white). Then the hue is lost and there is no way to recover it.

To solve this bug we must find a way or an other to never hit the maximum value of the lightness.

Seb35 added a comment.Jul 14 2015, 9:13 PM

Years ago, there was an ad in France for a washing powder, which washes whiter than white. Here it is also the case :-D (sorry, just amusing by this :)

I just tried some other colours (and the bug disappeared with these):
#61b261 empirically derived from the previous with the HSV color tool in GIMP
#2b5a2b computed to match HSL (120°, 0.66, 0.65), probably the smallest lightness to make it work

An "interesting" phenomenon is: when you make the mouse enter and leave a lot of times, the colours become darker, due to the integer rounding. You can clearly see it with the first proposed colour (~20 in-and-out of the mouse), but less for the second proposed colour. A small improvement would be to save the exact colour before changing the state, but that’s another bug.

Change 471328 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/Translate@master] Restyle statstable

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

Change 471328 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Restyle statstable

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