Last modified: 2014-10-01 11:02:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71200, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69200 - Implement checkbox spec in mediawiki.ui
Implement checkbox spec in mediawiki.ui
Status: NEW
Product: MediaWiki
Classification: Unclassified
MediaWiki UI (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://trello.com/c/JETLmm7F/7-check...
:
Depends on: 70909 70133 71506
Blocks: mediawiki.ui
  Show dependency treegraph
 
Reported: 2014-08-06 19:55 UTC by Matthew Flaschen
Modified: 2014-10-01 11:02 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Matthew Flaschen 2014-08-06 19:55:50 UTC
The initial implementation is in, but the spec has some further details.

One of the more noticeable ones is the green checkbox.  Per the spec, it's only supposed to be green when focused.  Otherwise, it is gray.  This is important on a page with a lot of checkboxes.

There is also a specified animation, and a "mixed" state (I'm not sure what this means, though, since HTML does not really have this).
Comment 1 Matthew Flaschen 2014-08-06 19:57:18 UTC
Sorry, I forgot to link the spec.  It's at https://trello.com/c/JETLmm7F/7-check-boxes
Comment 2 Jared Zimmerman (WMF) 2014-08-06 20:56:50 UTC
looking good, I'd like to get the animation in, prior to calling this closed. The mixed state is probably not needed at this time (I was channeling the needs of AutoCAD from my previous job)
Comment 3 Jared Zimmerman (WMF) 2014-08-06 21:03:02 UTC
here is a web example (from gmail) of mixed state checkboxes 
https://www.dropbox.com/s/1eyuj50vuoz6g7y/Screenshot%202014-08-06%2022.02.10.png
Comment 4 Matthew Flaschen 2014-08-06 22:13:40 UTC
Okay, so it basically means some of the represented items are checked.  I don't know if we have that anywhere.
Comment 5 Bartosz Dziewoński 2014-08-06 22:23:51 UTC
HTML doesn't really support tri-state checkboxes (or the 'indeterminate' checkedness state) – the standard does define such a thing [1], however it is only controllable via JavaScript (there isn't any way to define this state in HTML, not any UI that allows the user to set it). I believe the browser support for this is currently spotty at best, too. We shouldn't concern ourselves with it.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#dom-input-indeterminate
Comment 6 Matthew Flaschen 2014-08-07 20:11:37 UTC
Agreed, indeterminate/mixed should be considered out of scope for this bug.  I agree there are potential use cases, but let's file a separate bug when they arise.
Comment 7 Matthew Flaschen 2014-08-07 20:17:32 UTC
Jared, is it possible for one of the designers to make a 24x24 SVG of a gray check mark for checked.normal.yes (see https://trello.com/c/JETLmm7F/7-check-boxes).  That should allow us to make the focus distinction as specified (gray unfocused, green focused).
Comment 8 Jared Zimmerman (WMF) 2014-08-08 09:38:03 UTC
Can we use wikifont characters for this rather than svgs?
Comment 9 Jared Zimmerman (WMF) 2014-08-08 09:39:36 UTC
the check mark already exists in the wikifont
Comment 10 Matthew Flaschen 2014-08-09 01:58:51 UTC
(In reply to Jared Zimmerman (WMF) from comment #8)
> Can we use wikifont characters for this rather than svgs?

I don't know, but the initial implementation is already in core using background-image-svg (https://git.wikimedia.org/blob/mediawiki%2Fcore.git/287e641483e62c0e3070d3f35601f5c62f41eaf7/resources%2Fsrc%2Fmediawiki.ui%2Fcomponents%2Fcheckbox.less#L66).

So if you want to switch to WikiFont, that will require re-implementing it, whereas adding a focus distinction looks like a relatively straightforward enhancement.  See the bottom of this comment (I did a quick test with a fake image, and this works in Firefox):

> the check mark already exists in the wikifont

This is a different shape from the green one we currently have, though.  The green one has all hard edges.  The WikiFont one has a curve.  If that's understood, someone could make a 24x24 version of the WikiFont checkmark, which could easily be colored the appropriate shades of gray and green.

---
&:focus {
	+ label {
		&::before {
			.background-image-svg('images/checked_focus.svg', 'images/checked_focus.png');
		}
	}
}
---
Comment 11 Jared Zimmerman (WMF) 2014-08-09 08:08:12 UTC
If all the other mediawiki.ui controls will be using wikifont I'd prefer we go ahead and do this correctly vs quickly. It'll just come back to bite us if we don't.
Comment 12 Jon 2014-08-09 16:31:10 UTC
Whilst WikiFont is not in core we cannot rely on it Jared. We are a long way off from that point as I understand it. WikiFont to my knowledge is only being used by Flow.
Comment 13 Jared Zimmerman (WMF) 2014-08-09 17:23:44 UTC
I added a black, grey, and green version of the check to the trello board.
Comment 14 Matthew Flaschen 2014-08-10 04:12:13 UTC
(In reply to Jared Zimmerman (WMF) from comment #13)
> I added a black, grey, and green version of the check to the trello board.

Could someone please change the size to 24x24, or tell me how to do so?

It's easy to change the canvas size, but that just results in a tiny canvas, and big contents that overflow it.

I don't know how to scale the existing image proportionally.  The only command I found that almost does it is rsvg-convert, but it outputs in points, not pixels, and unfortunately, 24px is a non-integer number of points (19.2) which is apparently not allowed (either by SVG or rsvg, not sure).
Comment 15 Matthew Flaschen 2014-09-04 03:31:05 UTC
This is still blocked on 24x24 SVGs.

Also, we've decided not to use WikiFont for core/web.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links