Closed Bug 1209961 Opened 9 years ago Closed 9 years ago

(Gaia RTL 2.5) back & forward icons

Categories

(Firefox OS Graveyard :: Gaia::Shared, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
FxOS-S10 (30Oct)

People

(Reporter: kaze, Assigned: autra, NeedInfo)

References

Details

Attachments

(14 files)

53 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
55 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
54 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
57 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
52 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
54 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
57 bytes, text/x-github-pull-request
Details | Review
54 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
53 bytes, text/x-github-pull-request
julienw
: review+
Details | Review
53 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
54 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
53 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
53 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
46 bytes, text/x-github-pull-request
wilsonpage
: review+
Details | Review
Currently, the icon font used in Gaia uses “back” and “forward” to describe left and right arrows, respectively. This is confusing and adds unnecessary complexity to our stylesheets. I suggest that in the icon font: • we rename “back” and “back-light” as “left” and “left-light” • we rename “forward” and “forward-light” as “right” and “right-light” and in the gaia-icons.css stylesheet, we add two specific cases: • [data-icon="back"] uses “left” in LTR, “right” in RTL • [data-icon="forward"] uses “right” in LTR, “left” in RTL Thus, we could remove all direction-specific rules in our web components, building blocks and application stylesheets for these back & forward icons.
I forgot to mention the link: http://gaia-components.github.io/gaia-icons/
Component: Gaia → Gaia::Shared
While we’re at it, I suggest that all “mirrorable” icons should have a “-left” and “right” counterpart, to avoid a rather expensive `transform: scaleX(-1)` for RTL. I think it would only affect the “send” and “expand” icons. Ahmed, do you see other icons in that case? Again, we’d add specific rules to gaia-icons.css so that [data-icon="send"] uses “send-right” in LTR and “send-left” in RTL by default.
Flags: needinfo?(nefzaoui)
Pavel, Wilson, WDYT? If you patch the icon font, I’ll submit the patches to fix the stylesheets.
I'm happy with the naming change, but don't want to make generic global style rules. In the past this has been super confusing. Also these selectors won't penetrate into shadow-dom, so won't take affect any way. Whenever we're using icons in shadow-dom we have to redefine the [data-icon] {} selector.
+1 for Wilson's comment
Assignee: nobody → augustin.trancart
Attached file PR to gaia-icons
Here is the first part of the bug. I'm opening PR to the affected gaia-components then to gaia soon
Attachment #8669632 - Flags: review?(wilsonpage)
Hey Wilson, here is the update of gaia-button. Please r?
Attachment #8669865 - Flags: review?(wilsonpage)
Here is the one for gaia-dialog
Attachment #8669885 - Flags: review?(wilsonpage)
Attachment #8669901 - Flags: review?(wilsonpage)
Here is the PR for gaia-list
Attachment #8669917 - Flags: review?(wilsonpage)
For gaia-toolbar.
Attachment #8670137 - Flags: review?(wilsonpage)
Attachment #8669865 - Attachment description: Link to Github pull-request: https://github.com/gaia-components/gaia-checkbox/pull/7 → Link to Github pull-request (gaia-toolbar)
Attachment #8669865 - Attachment description: Link to Github pull-request (gaia-toolbar) → Link to Github pull-request (gaia-checkbox)
Attachment #8669901 - Attachment description: Link to Github pull-request for gaia-text-input → Link to Github pull-request (gaia-text-input)
Attachment #8669917 - Attachment description: Link to Github pull-request: gaia-list → Link to Github pull-request (gaia-list)
So I've done a search on every repo of gaia-components, and it seems that only these need updating + gaia-header. I know some work are still is progress for it, so I'll wait for it to land. Now, I need to check: - the gaia-icons version number in /shared/bower.json - the gaia-icons directory in /shared/elements/ (what should I do with it? Just copy the relevant files here?) - all building blocks in /shared/styles that may use gaia-icons. - all apps in /apps, /dev_apps and /tv_apps that may use gaia-icons Do you see something else to do?
Flags: needinfo?(wilsonpage)
(In reply to Augustin Trancart [:autra] from comment #14) > So I've done a search on every repo of gaia-components, and it seems that > only these need updating + gaia-header. I know some work are still is > progress for it, so I'll wait for it to land. > > Now, I need to check: > - the gaia-icons version number in /shared/bower.json > - the gaia-icons directory in /shared/elements/ (what should I do with it? > Just copy the relevant files here?) 1. Update "gaia-icons" version in shared/bower.json 2. `cd shared/` 3. `bower update gaia-icons` > - all building blocks in /shared/styles that may use gaia-icons. > - all apps in /apps, /dev_apps and /tv_apps that may use gaia-icons > > Do you see something else to do? Seems good to me!
Flags: needinfo?(wilsonpage)
Attachment #8669865 - Flags: review?(wilsonpage) → review+
Attachment #8669901 - Flags: review?(wilsonpage) → review+
Comment on attachment 8669885 [details] [review] Link to Github pull-request (gaia-dialog) Just a simple linting failure to fix, then we can merge.
Attachment #8669885 - Flags: review?(wilsonpage) → review+
Comment on attachment 8669917 [details] [review] Link to Github pull-request (gaia-list) One little nit, then we can merge :)
Attachment #8669917 - Flags: review?(wilsonpage) → review+
Comment on attachment 8669917 [details] [review] Link to Github pull-request (gaia-list) Hi Wilson, Flipping r? again, because I forgot to fix test/stress.html in my last commit. Thanks!
Attachment #8669917 - Flags: review+ → review?(wilsonpage)
(In reply to Wilson Page [:wilsonpage] from comment #19) > Comment on attachment 8669885 [details] [review] > Link to Github pull-request (gaia-dialog) > > Just a simple linting failure to fix, then we can merge. I don't understand it, seems a jshint fail to me. Should we exclude it? (Note that this was already failing before my patch, a quick bisection shows the culprit is 122f01706bb72e532dc3f9a6f979a9ed9f49e6ae)
Flags: needinfo?(wilsonpage)
I forgot to bump the version of gaia-fast-list. Please r? :-)
Attachment #8670707 - Flags: review?(wilsonpage)
While I'm at it, better update the example of gaia-button as well. Please r?
Attachment #8670720 - Flags: review?(wilsonpage)
Attachment #8669917 - Flags: review?(wilsonpage) → review+
(In reply to Augustin Trancart [:autra] from comment #22) > (In reply to Wilson Page [:wilsonpage] from comment #19) > > Comment on attachment 8669885 [details] [review] > > Link to Github pull-request (gaia-dialog) > > > > Just a simple linting failure to fix, then we can merge. > > I don't understand it, seems a jshint fail to me. Should we exclude it? > > (Note that this was already failing before my patch, a quick bisection shows > the culprit is 122f01706bb72e532dc3f9a6f979a9ed9f49e6ae) We can add this [1] to the .jshintrc. [1] https://github.com/gaia-components/gaia-fast-list/blob/master/.jshintrc#L34
Flags: needinfo?(wilsonpage)
Status: NEW → ASSIGNED
Hey Wilson, I'm currently making the changes to gaia to adapt the new version of gaia-icons, and I would like us to give Kaze's proposal a second thought: could we add BiDi-proof [data-icon="back"] and [data-icon="forward"] rules directly to gaia-icons ? And similarly, other BiDi-proof rules for every mirrored icons? I know you were against this, but IMO these general rules were confusing because of their poor semantic (you were pointing at the "general scaleX(-1) for *all* icons in RTL" rule we had for a while, right?). Here, this won't be the case, because these back and forward would be semantically correct, both in RTL and LTR. Moreover, we target specifically mirrored icons. I really think there won't be any confusion. Another advantage: this is far less risky and would yield a far smaller patch on gaia, as things would be transparent for most - if not all - of bb and apps. For the web components that has already landed, I would be able to remove all these specific rules that clutters their CSS. They are all identical across them anyway. Otherwise, we need to patch basically 3 levels of dependency (web components, building blocks and apps that use gaia-icons directly), where we could patch only one.
Attachment #8671809 - Flags: review?(wilsonpage)
Comment on attachment 8671809 [details] [review] Link to Github pull-request: https://github.com/gaia-components/gaia-icons/pull/51 Also asking feedback to Julien. WDYT of having mirrored icons in gaia-icons directly?
Attachment #8671809 - Flags: feedback?(felash)
Comment on attachment 8671809 [details] [review] Link to Github pull-request: https://github.com/gaia-components/gaia-icons/pull/51 Nice! Tiny formatting nit, then we can land :)
Attachment #8671809 - Flags: review?(wilsonpage) → review+
Comment on attachment 8671809 [details] [review] Link to Github pull-request: https://github.com/gaia-components/gaia-icons/pull/51 We discussed about it IRL and on IRC. I like the idea of having "logical" icons. Not sure of the best way to implement this, I don't think the performance impact would be that big because the selectors are quite simple. But I also had a look at the OpenType specification. It looks like we can do mirroring directly within the font. See http://www.microsoft.com/typography/otspec/TTOCHAP1.htm#ltrrtl (look for "Glyph-level mirroring"). So maybe it's possible to "simply" embed this information in the font: "ok, these glyphs need to be mirrored when we're in RTL context". Jonathan, you likely know better than me here... What do you think ?
Flags: needinfo?(jfkthame)
Attachment #8671809 - Flags: review?(wilsonpage)
Attachment #8671809 - Flags: review+
Attachment #8671809 - Flags: feedback?(felash)
Comment on attachment 8671809 [details] [review] Link to Github pull-request: https://github.com/gaia-components/gaia-icons/pull/51 sorry, flipped wilson's r+. But please wait for Jonathan's answer before merging...
Attachment #8671809 - Flags: review?(wilsonpage) → review+
(In reply to Julien Wajsberg [:julienw] from comment #32) > Comment on attachment 8671809 [details] [review] > Link to Github pull-request: > https://github.com/gaia-components/gaia-icons/pull/51 > > sorry, flipped wilson's r+. But please wait for Jonathan's answer before > merging... Oooops I just merged and then saw this comment. Sorry! We'll see what Johnathon says and followup if there is a smarter solution :)
Comment on attachment 8671894 [details] [review] Link to Github pull-request: https://github.com/gaia-components/gaia-icons/pull/52 This isn't essential, but thanks :)
Attachment #8671894 - Flags: review?(wilsonpage) → review+
Here is the patch for gaia-header. What's still missing: - patch for gaia - undo some of the css changes of the web components, now that we have a back and forward in gaia-icons.
Attachment #8671916 - Flags: review?(wilsonpage)
(In reply to Julien Wajsberg [:julienw] from comment #31) > Comment on attachment 8671809 [details] [review] > Link to Github pull-request: > https://github.com/gaia-components/gaia-icons/pull/51 > > We discussed about it IRL and on IRC. I like the idea of having "logical" > icons. Not sure of the best way to implement this, I don't think the > performance impact would be that big because the selectors are quite simple. > > But I also had a look at the OpenType specification. It looks like we can do > mirroring directly within the font. See > http://www.microsoft.com/typography/otspec/TTOCHAP1.htm#ltrrtl (look for > "Glyph-level mirroring"). > > So maybe it's possible to "simply" embed this information in the font: "ok, > these glyphs need to be mirrored when we're in RTL context". > > Jonathan, you likely know better than me here... What do you think ? Yes, an OpenType solution would be a possibility. What you'd want to do is to provide an extra "reversed" glyph in the font for each icon that should be direction-sensitive, and then use the 'rtlm' feature to replace the default (LTR) glyph with its RTL counterpart. This would be a lighter-weight approach than the CSS rules, as it doesn't involve any extra selector-matching. The font is already going through OpenType feature processing; adding one extra simple substitution feature to the font means there'll be one more lookup to process during text shaping, but that's pretty cheap -- and the result will be cached by the font's shaped-word cache, reducing the cost still further. If you want to go this way, I guess the icons should be named things like arrow-forward and arrow-back (rather than arrow-right and arrow-left). Actually, you'd perhaps want to have both logically- and physically-named icons in the font, with mirroring applied only to the logical ones; then in any given context the designer can choose whether a particular icon should be physical or logical.
Flags: needinfo?(jfkthame)
I really like Jonathan solution, but I'm not knowledgeable enough to do this correctly yet :-) I suggest to open a follow-up, and I'll try to give it a shot later if nobody else shows up. Does anybody have pointers to help me understand how to use this 'rtlm' feature? Moreover, it seems that grunt-webfont does not support this (or I didn't find out how), which might slow us down. If this statement is correct, we would need to either propose this feature to grunt-webfont, or move away from it...
Hey Wilson, could you release a new version of gaia-header? I need it to make a patch to gaia to update gaia-icons, gaia-list gaia-header at the same time, in order not to break anything :-) Thanks!
Flags: needinfo?(wilsonpage)
Flags: needinfo?(wilsonpage)
Comment on attachment 8670707 [details] [review] Link to Github pull-request (gaia-fast-list) Travis tests failing
Attachment #8670707 - Flags: review?(wilsonpage)
Another advantage of using rtlm in the font: mirroring would also work when using `content:` directly in css. There's a few cases where people do that (when they want the arrow in :after for ex).
(In reply to Augustin Trancart [:autra] from comment #43) > Another advantage of using rtlm in the font: mirroring would also work when > using `content:` directly in css. There's a few cases where people do that > (when they want the arrow in :after for ex). Perhaps, though I wonder if the need to apply bidi-override to it could sometimes make that tricky. I believe you'd be able to do, for example: foo:after { content: "arrow-forward"; font-family: gaia-icons; unicode-bidi: bidi-override; } and mirroring of the arrow should work; but if the 'content:' contains other text in addition to the icon, applying bidi-override to it might be more problematic.
(In reply to Augustin Trancart [:autra] from comment #39) > I really like Jonathan solution, but I'm not knowledgeable enough to do this > correctly yet :-) I suggest to open a follow-up, and I'll try to give it a > shot later if nobody else shows up. Does anybody have pointers to help me > understand how to use this 'rtlm' feature? > > Moreover, it seems that grunt-webfont does not support this (or I didn't > find out how), which might slow us down. If this statement is correct, we > would need to either propose this feature to grunt-webfont, or move away > from it... I think the first step would be to make it work with fontforge without grunt... But I don't have a clue ;)
(In reply to Jonathan Kew (:jfkthame) from comment #44) > > Perhaps, though I wonder if the need to apply bidi-override to it could > sometimes make that tricky. Why would you apply bidi-override? If you don't want the outer direction to be applied, wouldn't it be an indication to use either `arrow-left` or `arrow-right` instead?
Unless I'm misunderstanding something, I believe you'll always need to use bidi-override in order to get the icon to be treated as an RTL text run (when it's in a context with dir=rtl). Otherwise, the fact that the icon name -- which is what's used as the text "content" to access it -- consists of strong LTR characters will mean that it becomes an LTR text run regardless of the directionality of its container. I.e. if you have something along the lines of <div dir=rtl> الخط العربي <span class="icon">arrow-forward</span> </div> the <span> will be a LTR text run because of the Unicode directionality of its contents, and so any 'rtlm' feature would NOT be applied. To make the <span> override the properties of its contents, and force it to adopt RTL directionality, it needs to be styled with "unicode-bidi: bidi-override".
The other thing I notice, after a little experimentation, is that it doesn't actually work to use ligatures like this with bidi overrides. :( So things are a bit messier than I'd been assuming, if you do want to use those ligatures. In effect, you'd need a second set of ligature rules with the strings entered backwards: i.e. you'd have a ligature named 'arrow-forward' rendering the right-pointing arrow for LTR content, and one named 'drawkcab-worra' for RTL content. In which case that ligature might as well go directly to the left-pointing arrow, and there's no need for a mirroring feature. Or do the gaia apps use the individual PUA codepoints to access the icons? (I see that the glyphs in gaia-icons.ttf are encoded BOTH as ligatures and as PUA character codes.) If that's the case, 'rtlm' can indeed be used to swap in mirrored glyphs.
(In reply to Jonathan Kew (:jfkthame) from comment #48) > you'd have a ligature named 'arrow-forward' > rendering the right-pointing arrow for LTR content, and one named > 'drawkcab-worra' for RTL content Uh, I meant 'drawrof-worra' here, of course.
Hi Wilson, while making the gaia patch, I realized I forgot the "send" icon in the bidi-helper.css :-( Sorry for that! Please r?
Attachment #8672773 - Flags: review?(wilsonpage)
I think we'll investigate the in-font solution later than 2.5. Augustin, will you please file a separate bug, and add that bug # as a comment near your added CSS ?
See Also: → 1214127
So this PR adds the comment. Hopefully, this will be the last one for gaia-icons for this bug! Wilson, please r?
Attachment #8672977 - Flags: review?(wilsonpage)
Don't forget to file a separate bug for the in-font mirroring experience.
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master Hey Wilson, here is the last one. Please r?
Attachment #8673163 - Flags: review?(wilsonpage)
Julien, already done in bug 1214127 :-)
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master Please update gaia-icons and gaia-header inside apps/camera too. Make sure the gaia-icons version installed by Bower *exactly* matches the one in shared/elements/gaia-icons. Cheers!
Attachment #8673163 - Flags: review?(wilsonpage)
> Please update gaia-icons and gaia-header inside apps/camera too There's 4 major versions to update for gaia-header and it breaks stuff, unfortunately (especially the "take picture" button). Can we open a follow-up for that? I'd rather land this one quickly, as it potentially blocks other RTL works. > Make sure the gaia-icons version installed by Bower *exactly* matches the one in shared/elements/gaia-icons. Should be ok now :-) Thanks
Flags: needinfo?(wilsonpage)
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master Code looks good, assuming you have tested on device :)
Flags: needinfo?(wilsonpage)
Attachment #8673163 - Flags: review+
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master autra: Please update to gaia-icons v0.10.5 to fix a FOUC issue we were having. See bug 1175805.
Attachment #8673163 - Flags: review+
Flags: needinfo?(augustin.trancart)
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master Done, updated to 0.10.5
Flags: needinfo?(augustin.trancart)
Attachment #8673163 - Flags: review?(wilsonpage)
Comment on attachment 8673163 [details] [review] [gaia] Phoxygen:bug1209961-update_gaia_icons > mozilla-b2g:master Perfect, thanks! :D
Attachment #8673163 - Flags: review?(wilsonpage) → review+
Yay \o/
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S10 (30Oct)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: