Closed Bug 1053708 Opened 10 years ago Closed 10 years ago

Make SMS main User Interface RTL-friendly

Categories

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

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(ux-b2g:2.2)

RESOLVED FIXED
2.1 S6 (10oct)
ux-b2g 2.2

People

(Reporter: nefzaoui, Assigned: julienw)

References

Details

(Whiteboard: [p(2.1S6)=1][p(2.1S5)=2])

Attachments

(4 files, 1 obsolete file)

      No description provided.
Blocks: gaia-rtl, 964033
Attached file Github pull-request (obsolete) —
This part is ready for review. :)
Attachment #8472928 - Flags: review?(felash)
Comment on attachment 8472928 [details] [review]
Github pull-request

I think we should try to use -moz-padding-start and friends as much as possible, instead of overriding all rules like this.
Attachment #8472928 - Flags: review?(felash)
Blocks: messages-rtl
No longer blocks: gaia-rtl
ux-b2g: --- → 2.2
Hey Ahmed, we (as "the SMS team) would like to take this bug in our sprint, is it fine for you?
Flags: needinfo?(nefzaoui.ahmed)
Whiteboard: [p=2]
Target Milestone: --- → 2.1 S5 (26sep)
Hey Julien, Yeah fine.
Flags: needinfo?(nefzaoui.ahmed)
Back on track with a new device. :)

(In reply to Julien Wajsberg [:julienw] from comment #2)
> Comment on attachment 8472928 [details] [review]
> Github pull-request
> 
> I think we should try to use -moz-padding-start and friends as much as
> possible, instead of overriding all rules like this.

So, from the PR:
> how do you feel about using "unset" instead of "auto" here and in all other properties that you reset ?
Yes actually seems to be more effective!! Already started using it more often in other patches :)

> how about using -moz-padding-start and -moz-padding-end instead of rewriting everything like this?
Also don't mind but since every other single CSS file had its properties rewritten manually I think it's just a matter of consistency ? Also if my understand for them is right then they implicitly does the same thing as explicitly overriding things, only a little fancier? :)
(In reply to Julien Wajsberg [:julienw] from comment #3)
> Hey Ahmed, we (as "the SMS team) would like to take this bug in our sprint,
> is it fine for you?

Just to be sure, this means the SMS team will work on it ?
Flags: needinfo?(felash)
Yeah, this means we (the SMS team) committed to fixing this bug before Tuesday 30th :)
Flags: needinfo?(felash)
We'll ask you feedback so feel free to give advice as you have more experience in this :)
(In reply to Ahmed Nefzaoui [:Nefzaoui] from comment #5)
> Back on track with a new device. :)
> 
> (In reply to Julien Wajsberg [:julienw] from comment #2)
> > Comment on attachment 8472928 [details] [review]
> > Github pull-request
> > 
> > I think we should try to use -moz-padding-start and friends as much as
> > possible, instead of overriding all rules like this.
> 
> So, from the PR:
> > how do you feel about using "unset" instead of "auto" here and in all other properties that you reset ?
> Yes actually seems to be more effective!! Already started using it more
> often in other patches :)
> 
> > how about using -moz-padding-start and -moz-padding-end instead of rewriting everything like this?
> Also don't mind but since every other single CSS file had its properties
> rewritten manually I think it's just a matter of consistency ? Also if my
> understand for them is right then they implicitly does the same thing as
> explicitly overriding things, only a little fancier? :)

This is one way to look at it.

The other way to look at it is that if take the habit to use -moz-padding-start and its friends, we'll be RTL-compatible for free. The issue is not about being RTL-compatible now, but to be RTL-compatible in the long run. If we'd override things manually, then as a developer it's difficult to think of it for every patches when you're not using a RTL language frequently.

As a result, RTL support will break for sure.

That's why I want to use -moz-padding-start and such: so that we don't need to think about it: when we'll do CSS changes in the future, we'll change the values in one place only.

Moreover it helps testing a feature that's not so used, and as a result we'll make the web better :)
Attached file github PR
WIP, built up on top of Ahmed's useful work
Assignee: nobody → felash
Attachment #8472928 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Pushed a nearly finished patch, I just need to also change what landed in bug 1067228.
Comment on attachment 8493220 [details] [review]
github PR

Hey Oleg,

I think this is ready for a first review.

Known issues or questions:
* the "(Contact name (+1" title; I'll file a separate bug for this, this may be a gecko issue.
* should the "new message" icon be reversed or done differently? I don't know how we write arabic :) Ahmed, what do you think?
* the incoming/outgoing messages position are not changed in this bug per IRC discussion with Ahmed.

I decided to minimize the amount of RTL-specific overrides by using standard or 
"soon-standard" properties that Gecko support. Notably:
* -moz-(padding/margin/border)-(start/end)
* text-align: (start/end)
* when using both left/right for absolutely positioned elements and there is a conflict (because width is set too), then either left or right is privileged depending on the container's text direction
* converted one float into flex, which supports RTL from the start

Where possible I also simply removed some unused CSS code.

I don't think we need to be perfect here. We obviously need that LTR does not regress, and if we can catch some RTL issues now it's better, but let's not be overstrict :)

Tell me what you think!
Attachment #8493220 - Flags: review?(azasypkin)
(In reply to Julien Wajsberg [:julienw] from comment #12)
> * should the "new message" icon be reversed or done differently? I don't
> know how we write arabic :) Ahmed, what do you think?

Good point! Ni? Ahmed to not miss this :)
Flags: needinfo?(nefzaoui.ahmed)
> * should the "new message" icon be reversed or done differently? I don't
> know how we write arabic :) Ahmed, what do you think?

Seems fine as it is, I'm not sure if the icon belongs to the icon font or currently lives as a PNG image, but either way either creating flipped PNG asset or using scaleX(-1) to show that the pen is pointed to the right (as if it was right-to-left writing) would be awesome to have too :)

> * the "(Contact name (+1" title; I'll file a separate bug for this, this may be a gecko issue.
I'm not sure I understand this issue ? Screenshot please? :)

Also, another concern that I have is the fact that in RTL view the "..." are shown behind the message in the main UI and the message is quoted only from it's last part as if it was read from the right.. (adding a screenshot)
Now I'm not sure what property can control that however if that's possible, I think combining it with -moz-dir(rtl) and -moz-dir(ltr) to handle the cases where:

* It's a non-RTL text so we show the first words of the text message from the left and the "..." are on the far right of the <span>
and
* When it's a RTL text (e.g. Arabic) so we show the first words from the right and have the "..." to the far left.
Flags: needinfo?(nefzaoui.ahmed)
If we can control the position of the "..." depending on the language of the message.. :)
(In reply to Ahmed Nefzaoui [:Nefzaoui] from comment #14)
> > * should the "new message" icon be reversed or done differently? I don't
> > know how we write arabic :) Ahmed, what do you think?
> 
> Seems fine as it is, I'm not sure if the icon belongs to the icon font or
> currently lives as a PNG image, but either way either creating flipped PNG
> asset or using scaleX(-1) to show that the pen is pointed to the right (as
> if it was right-to-left writing) would be awesome to have too :)

The "problem" I see here is that the fact that the pen is pointed to the left is (IMO) more because the writer is right-handed. As a right-handed person, I don't think I'd point the pen to the right to write RTL characters. What do you think?

> 
> > * the "(Contact name (+1" title; I'll file a separate bug for this, this may be a gecko issue.
> I'm not sure I understand this issue ? Screenshot please? :)

Sure, one moment :)

> 
> Also, another concern that I have is the fact that in RTL view the "..." are
> shown behind the message in the main UI and the message is quoted only from
> it's last part as if it was read from the right.. (adding a screenshot)
> Now I'm not sure what property can control that however if that's possible,
> I think combining it with -moz-dir(rtl) and -moz-dir(ltr) to handle the
> cases where:
> 
> * It's a non-RTL text so we show the first words of the text message from
> the left and the "..." are on the far right of the <span>
> and
> * When it's a RTL text (e.g. Arabic) so we show the first words from the
> right and have the "..." to the far left.

It might make sense to do simple testcases in a simple HTML file, it may be gecko issues. Anyway, this is more a matter for bug 1053709 IMO.
(In reply to Julien Wajsberg [:julienw] from comment #16)
> (In reply to Ahmed Nefzaoui [:Nefzaoui] from comment #14)
> > > * should the "new message" icon be reversed or done differently? I don't
> > > know how we write arabic :) Ahmed, what do you think?
> > 
> > Seems fine as it is, I'm not sure if the icon belongs to the icon font or
> > currently lives as a PNG image, but either way either creating flipped PNG
> > asset or using scaleX(-1) to show that the pen is pointed to the right (as
> > if it was right-to-left writing) would be awesome to have too :)
> 
> The "problem" I see here is that the fact that the pen is pointed to the
> left is (IMO) more because the writer is right-handed. As a right-handed
> person, I don't think I'd point the pen to the right to write RTL
> characters. What do you think?

I just happen to be left-handed ..
Well.. Haven't thought of it that way TBH. :) But yes, makes sense!!

> > > * the "(Contact name (+1" title; I'll file a separate bug for this, this may be a gecko issue.
> > I'm not sure I understand this issue ? Screenshot please? :)
>Sure, one moment :)

Thanks :)
Comment on attachment 8493220 [details] [review]
github PR

I've left some questions and few nits on Github, but otherwise SMS part looks good to me! IMO it's better to land this base RTL patch sooner and iterate through follow-ups if we have other issues.
Attachment #8493220 - Flags: review?(azasypkin) → review+
Whiteboard: [p=2] → [p(2.1S6)=1][p(2.1S5)=2]
Target Milestone: 2.1 S5 (26sep) → 2.1 S6 (10oct)
Hey Fang,

In this patch I adjust how the DSDS indicators look like. I think this is closer to the spec in attachment 8475084 [details], but please tell me.

On this image, you have a screenshot for the current master, a screenshot for the patch, and a screenshot for the patch in Right-to-Left mode. Please tell me if it looks fine for you !

You can directly test the patch from the github pull request, it's uptodate.
Attachment #8501738 - Flags: ui-review?(fshih)
Comment on attachment 8493220 [details] [review]
github PR

Asking for a review from Arnau for the changes in BB.
Attachment #8493220 - Flags: review?(rnowmrch)
Comment on attachment 8501738 [details]
Comparison before/after change

It looks good!! Thanks Julien!
Attachment #8501738 - Flags: ui-review?(fshih) → ui-review+
Comment on attachment 8493220 [details] [review]
github PR

Overall, the changed properties in BB looks good to me.
But RTL stuff is quite confusing to me, not really sure how things should be positioned, or icons rotated... I guess you have a better idea how the layout should fit :)
Attachment #8493220 - Flags: review?(rnowmrch) → review+
Depends on: 1080833
master: f849fc9505b8466bc0ab4aca58891e0b268c21be
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
\o/
Blocks: 1081852
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: