'99+' case (since it occupies three spaces) looks a little bit tight:
Some examples (the browser display scale is 110%):
The example from cawiki - 'D' in 'Discussion' takes more space than 'T' in 'Talk'
Monobook skin:
Etonkovidova | |
Aug 9 2016, 2:42 AM |
F5135354: Screen Shot 2016-12-22 at 12.32.51 PM.png | |
Dec 22 2016, 8:37 PM |
F5130852: Screen Shot 2016-12-21 at 4.59.29 PM.png | |
Dec 22 2016, 1:28 AM |
F5130850: Screen Shot 2016-12-21 at 5.14.35 PM.png | |
Dec 22 2016, 1:28 AM |
F4397118: Screen Shot 2016-08-24 at 9.41.46 AM.png | |
Aug 24 2016, 4:48 PM |
F4397058: Screen Shot 2016-08-24 at 9.31.18 AM.png | |
Aug 24 2016, 4:48 PM |
F4397026: Screen Shot 2016-08-24 at 9.12.15 AM.png | |
Aug 24 2016, 4:48 PM |
F4397100: Screen Shot 2016-08-24 at 9.30.27 AM.png | |
Aug 24 2016, 4:48 PM |
F4397126: Screen Shot 2016-08-24 at 9.41.46 AM.png | |
Aug 24 2016, 4:48 PM |
'99+' case (since it occupies three spaces) looks a little bit tight:
Some examples (the browser display scale is 110%):
The example from cawiki - 'D' in 'Discussion' takes more space than 'T' in 'Talk'
The changes have been made and they are in UI:
top: 9px;
left: 55%;
font-size: 0.9em;
vs previously implemented
top: 10px; left: 50%; font-size: 0.8em;
However, there are not much visual differences, in my opinion (all screenshots are made in full screen mode, 100% scale):
@Pginer-WMF and @jmatazzoni: 99+ Looks better, in terms of the space around, if font-size: 0.8em; :
Compare with font-size: 0.9em;
The main problem seems to be that the counter in the badge is not considered when the layout is adjusted for the elements in the personal toolbar.
Keeping a fixed separation that works well for all possible lengths of the badge seems hard: too much space will make notification icons to feel too far apart when there is no badge and too few space will cause overlaps.
If it is not possible to make enough space for the badge we could adjust the degree it overlaps with the icon (the "left: 55%" CSS rule). One option is to increase the overlap in general (e.g., changing it back to left: 50%), but that won't get much extra room. Another option is to treat the "99+" case specially, and only in that case allow a bigger overlap (e.g., "left: 35%"). This will cover a bigger part of the icon, but that should not be a big discoverability problem for users that have reach that volume of notifications.
It's possible to do this, and we even got it working, but it causes a problem: if you have the popup open and mark a notification as read, the number in the badge changes. If it changes from e.g. 10 to 9, the width of the badge shrinks, and so the badge (along with everything to the left of it) moves to the right. The popup is anchored to the badge, so it moves to the right too. So the net effect is that you clicked a button, and in response to that click the button moved away from under your mouse.
You can try this out yourself by setting width: auto; on the <a> in the badge (a.mw-echo-notifications-badge) and position: relative; left: 5px; on the :after of that <a>. You can also fake the number on the badge by changing the data-counter-text attribute.
Thanks for the clarification @Catrope. We definitely don't want the panel to shake as you mark notifications as read. Do you think there will be issues in supporting the other alternative I described (adjusting the "left" overlap percentage when the counter is "99+")?
Adjusting the left percentage won't cause this issue and should be doable. Figuring out that we are in the 99+ case in software might be a bit tricky though (because of translations and different numeral systems), so maybe we could apply the adjusted left percentage in all cases where the badge text is longer than two characters.
If anyone were to ask me, I'd advise just putting in some extra space next to the trays to accommodate the worst case and live with it looking extra-spacey when the counters are at low numbers. Would that be wrong?
Anyway, @Etonkovidova, I'm seeing this in the product review column. But I don't see where any changes were made. So I'm not sure what is being asked of me. @Catrope, did you settle on an approach here? Should I put it back in Dev?
I'd prefer to fix the case where there is a problem ("99+") without generating a problem for more common cases (according to our data, 99% of the users have 5 or less unread notifications).
In the comments above I proposed the following: treat the "99+" case specially, and only in that case allow a bigger overlap with the badge (e.g., "left: 35%"). this makes the badge to act as if the text was right aligned (expanding to the left when needed instead of taking additional space to the right).
The comment form Roan where he indicates that "Figuring out that we are in the 99+ case in software might be a bit tricky though" is a bit confusing to me because is the software the one writing "99+" in the first place so I expected there should be a more elegant way to know the number of notifications a user has beyond parsing the badge text. Some possible ideas:
Based on @Etonkovidova's screenshots above, it looks like changes were made but this issue is not fixed. @Catrope suggested:
maybe we could apply the adjusted left percentage in all cases where the badge text is longer than two characters.
@SBisson, you worked on this. Would that solution be complicated? Would it work? As Pau points out, the 99+ case is pretty rare, so I'm moving this off the Q2 board (to Triage/Hot). But I'd like to fix it if we can. Stephane, if you think this will be easy to fix, go ahead and move it back to Q2.
I wrote down what this would look like (it's a few simple CSS changes but I don't remember what they are), but not in a very useful place. You should be able to find it by looking through my (Roan Kattouw (WMF)'s) edits on [[WP:VPT]] on enwiki
@jmatazzoni, @Catrope, @SBisson, In case it was lost in the comments above, I'll mention it again:
I'd prefer to fix the case where there is a problem ("99+") without generating a problem for more common cases (according to our data, 99% of the users have 5 or less unread notifications).
In the comments above I proposed the following: treat the "99+" case specially, and only in that case allow a bigger overlap with the badge (e.g., "left: 35%"). this makes the badge to act as if the text was right aligned (expanding to the left when needed instead of taking additional space to the right).
The comment form Roan (T142454#2602121) where he indicates that "Figuring out that we are in the 99+ case in software might be a bit tricky though" is a bit confusing to me because is the software the one writing "99+" in the first place so I expected there should be a more elegant way to know the number of notifications a user has beyond parsing the badge text. Some possible ideas:
Is any of these a viable solution for the specific "+99" case?
Change 328404 had a related patch set uploaded (by Sbisson):
Adjust unread counter position based on length
Checked in betalabs - IE11, Windows 7, Chrome 54. FF 50, Safari 10.
@Pginer-WMF, please review the screenshots.
Added the screenshot for cawiki (to check the case with 'D') - looks ok.
Interestingly, that in monobook skin, two-digit numbers cover the icons almost completely. This is a slight regression - look at the monobook screenshot in the ticket description. Also, I added tabs 'unwatch' to see how new layout fits for users with many tabs.
Good. The fix seems to avoid the overlap (except for the Monobook case, which can have a separate ticket).
Change 328730 had a related patch set uploaded (by Sbisson):
Use the right counter for the right badge