[Accessibility] Keyboard delete should have a role key instead of button.

RESOLVED FIXED

Status

Firefox OS
Gaia::Keyboard
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: yzen, Assigned: Santiago Saavedra, Mentored)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][lang=html][lang=js])

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
All keyboard/keypads/pinpads etc should have delete control updated from being a button to being a key (role). This means that delete action would now happen on tapup instead of double tap.
(Reporter)

Comment 1

2 years ago
We need to update these keyboards:

apps/callscreen
apps/communications/dialer
apps/emergency-call
apps/keyboard
apps/system/lockscreen
Mentor: yzenevich@mozilla.com
Whiteboard: [good first bug][lang=html][lang=js]

Comment 2

2 years ago
Hey i would like to work on this bug ! can u please help me get started?
(Assignee)

Comment 3

2 years ago
I would like to work on this bug. I have updated already most of the keyboards, but I would like input on the apps/keyboard app.

Concisely, I'd like to know whether you are talking about the "backspace key", and if so, maybe other keys should also be rendered as role="key", not just delete (maybe Shift or Alt). These are all currently buttons.
Flags: needinfo?(yzenevich)
(Assignee)

Comment 4

2 years ago
I have what I have fixed at https://github.com/ssaavedra/gaia/tree/bugfix-1212588-keyboard-delete-role-key
(Assignee)

Updated

2 years ago
Flags: needinfo?(apastor)
Santiago, create a pull request to master with the title 'Bug 1212588 - ... ', and that will automatically attach a patch here. Thanks for working on this!
Assignee: nobody → ssaavedra
Flags: needinfo?(apastor)
(Reporter)

Comment 6

2 years ago
(In reply to Santiago Saavedra from comment #4)
> I have what I have fixed at
> https://github.com/ssaavedra/gaia/tree/bugfix-1212588-keyboard-delete-role-
> key

Hi Santiago, thanks for taking this, what Alberto mentioned about creating Pull Request is right. I'll then be able to give you inline comments straight in Github.

Regarding your question about other buttons within a keyboard, I think it's unnecessary at this point. The reason is that role key allows screen reader users to activate the button without double tapping (simply focusing on the button will activate it). This is something users on other platform are used to so we'll avoid it for now.
Flags: needinfo?(yzenevich)

Comment 7

2 years ago
Created attachment 8690848 [details] [review]
[gaia] ssaavedra:bugfix-1212588-keyboard-delete-role-key > mozilla-b2g:master
(Assignee)

Comment 8

2 years ago
(In reply to Yura Zenevich [:yzen] from comment #6)
> Hi Santiago, thanks for taking this, what Alberto mentioned about creating
> Pull Request is right. I'll then be able to give you inline comments
> straight in Github.

Alright, that has just been done.
 
> Regarding your question about other buttons within a keyboard, I think it's
> unnecessary at this point. The reason is that role key allows screen reader
> users to activate the button without double tapping (simply focusing on the
> button will activate it). This is something users on other platform are used
> to so we'll avoid it for now.

I am talking specifically about keys such as ALT and CAPS_LOCK.

Speaking about other platforms, I don't know about iOS, but Talkback in Android both with AOSP Keyboard and Swype, assumes every key is a "key" and acts on keyup (including for Enter/Search, spacebar, ALT and shift buttons). I find that to be much less frustrating to use.
Flags: needinfo?(yzenevich)
(Reporter)

Comment 9

2 years ago
(In reply to Santiago Saavedra from comment #8)
> (In reply to Yura Zenevich [:yzen] from comment #6)
> > Hi Santiago, thanks for taking this, what Alberto mentioned about creating
> > Pull Request is right. I'll then be able to give you inline comments
> > straight in Github.
> 
> Alright, that has just been done.
>  
> > Regarding your question about other buttons within a keyboard, I think it's
> > unnecessary at this point. The reason is that role key allows screen reader
> > users to activate the button without double tapping (simply focusing on the
> > button will activate it). This is something users on other platform are used
> > to so we'll avoid it for now.
> 
> I am talking specifically about keys such as ALT and CAPS_LOCK.
> 
> Speaking about other platforms, I don't know about iOS, but Talkback in
> Android both with AOSP Keyboard and Swype, assumes every key is a "key" and
> acts on keyup (including for Enter/Search, spacebar, ALT and shift buttons).
> I find that to be much less frustrating to use.

Good point, yes, on iOS double tap is required for all keyboard buttons. We are trying out something in between at the moment. Delete was an initial control suggested to be converted into key as it gets as much use as character keys. We might be consider adding the ones you mentioned later on , once we have some feedback.
Flags: needinfo?(yzenevich)
(Reporter)

Comment 10

2 years ago
ok Santiago, talked a bit more with a screen reader user, lets add role key for delete + caps + alt.

Now regarding the logic in key_view.js , we do not want to loose styling that special keys have so we need to do both: add styling and role key to them. We might have to check if target keyCode is one of delete, caps or alt and if so set the attr in the if (target.isSpecialKey) {...} case. I'm pretty sure semantically those keys are special (non-chacaracter) keys so we should still account for them inside the isSpecialKey logic.

If you have some suggestions about making it more awesome, feel free to share.
(Assignee)

Comment 11

2 years ago
(In reply to Yura Zenevich [:yzen] from comment #10)
> ok Santiago, talked a bit more with a screen reader user, lets add role key
> for delete + caps + alt.

Agreed.

> Now regarding the logic in key_view.js , we do not want to loose styling
> that special keys have so we need to do both: add styling and role key to
> them. We might have to check if target keyCode is one of delete, caps or alt
> and if so set the attr in the if (target.isSpecialKey) {...} case. I'm
> pretty sure semantically those keys are special (non-chacaracter) keys so we
> should still account for them inside the isSpecialKey logic.
> 
> If you have some suggestions about making it more awesome, feel free to
> share.

I found the screen reader to be somewhat unreliable (on the Flame, sometimes the audio flinches when changing from letter to letter), but that does not seem to be related to this issue. I might open a bug about that, but I'm clueless on where to start with it.

Regarding semantics, I agree with you that they should probably be kept as special keys.

I added the logic where you said, and therefore, I also had to add KeyEvents as a global to key_view.js to keep the linter happy and be able to test for it.

However, I don't seem totally comfortable with that logic inside key_view.js.

Why? I can't tell any specifics currently in the codebase, but I imagine that if the Japanese keyboard had a different layout and had a key to switch from hiragana to katakana (different to Alt, which would still be used for symbols): then that key should also be handled as a non-button special key.

I think it can be more rational if we get the check the other way around: test which keys must be buttons (and probably argue why). At the end of the day, it's a keyboard rendered on a screen. Semantically, all there is are keys, no buttons. The enter key on my laptop does not behave that much different than any of my character keys.

This is of course just my opinion. I would love to know your thoughts about this. If you like the current situation, it's already on the pull request. If you incline with the alternative, it's in an alternate branch also on my repo (not squashed commit, so that differences are easier to see).

Change is at:

https://github.com/ssaavedra/gaia/tree/bugfix-1212588-keyboard-delete-role-key-alternative

Specifically, https://github.com/ssaavedra/gaia/commit/f5e34ffdcbddd46ffa5348cc0edf9b3ef1c49df2


BTW, I haven't been introduced to proper netiquette in this matter, so I ask you: is it ok that I needinfo? you each time I answer?
Flags: needinfo?(yzenevich)
(Reporter)

Comment 12

2 years ago
(In reply to Santiago Saavedra from comment #11)
> (In reply to Yura Zenevich [:yzen] from comment #10)
> > ok Santiago, talked a bit more with a screen reader user, lets add role key
> > for delete + caps + alt.
> 
> Agreed.
> 
> > Now regarding the logic in key_view.js , we do not want to loose styling
> > that special keys have so we need to do both: add styling and role key to
> > them. We might have to check if target keyCode is one of delete, caps or alt
> > and if so set the attr in the if (target.isSpecialKey) {...} case. I'm
> > pretty sure semantically those keys are special (non-chacaracter) keys so we
> > should still account for them inside the isSpecialKey logic.
> > 
> > If you have some suggestions about making it more awesome, feel free to
> > share.
> 
> I found the screen reader to be somewhat unreliable (on the Flame, sometimes
> the audio flinches when changing from letter to letter), but that does not
> seem to be related to this issue. I might open a bug about that, but I'm
> clueless on where to start with it.

Yeah we have a bug in audio channel management, it's pretty bad and affects other things such as tone sounds in the Dialer app 

> 
> Regarding semantics, I agree with you that they should probably be kept as
> special keys.
> 
> I added the logic where you said, and therefore, I also had to add KeyEvents
> as a global to key_view.js to keep the linter happy and be able to test for
> it.
> 
> However, I don't seem totally comfortable with that logic inside key_view.js.
> 
> Why? I can't tell any specifics currently in the codebase, but I imagine
> that if the Japanese keyboard had a different layout and had a key to switch
> from hiragana to katakana (different to Alt, which would still be used for
> symbols): then that key should also be handled as a non-button special key.
> 
> I think it can be more rational if we get the check the other way around:
> test which keys must be buttons (and probably argue why). At the end of the
> day, it's a keyboard rendered on a screen. Semantically, all there is are
> keys, no buttons. The enter key on my laptop does not behave that much
> different than any of my character keys.

Totally agree, we will definitely have less cases where something is not a key, so if you are willing to tackle that here, go for it.

> 
> This is of course just my opinion. I would love to know your thoughts about
> this. If you like the current situation, it's already on the pull request.
> If you incline with the alternative, it's in an alternate branch also on my
> repo (not squashed commit, so that differences are easier to see).
> 
> Change is at:
> 
> https://github.com/ssaavedra/gaia/tree/bugfix-1212588-keyboard-delete-role-
> key-alternative
> 
> Specifically,
> https://github.com/ssaavedra/gaia/commit/
> f5e34ffdcbddd46ffa5348cc0edf9b3ef1c49df2
> 
> 
> BTW, I haven't been introduced to proper netiquette in this matter, so I ask
> you: is it ok that I needinfo? you each time I answer?

Yes, for sure, otherwise I will likely miss it. This way it shows up as a request on my dashboard (https://bugzilla.mozilla.org/page.cgi?id=mydashboard.html).
Flags: needinfo?(yzenevich)
(Assignee)

Comment 13

2 years ago
I have updated it as a new approach that I think is better, let me know. I isolated the logic into the layout_normalizer, and added a key.isButton property, as there exists a key.isSpecial already to handle this case in a more general case. This way we have the KeyEvents enumerated all in one file (both for special keys and for button-special keys).
Flags: needinfo?(yzenevich)
(Assignee)

Updated

2 years ago
See Also: → bug 1227174
(Reporter)

Comment 14

2 years ago
(In reply to Santiago Saavedra from comment #13)
> I have updated it as a new approach that I think is better, let me know. I
> isolated the logic into the layout_normalizer, and added a key.isButton
> property, as there exists a key.isSpecial already to handle this case in a
> more general case. This way we have the KeyEvents enumerated all in one file
> (both for special keys and for button-special keys).

Hi Santiago, the PR looks good, left one nit in there and also notice there's a failing unit test. You also need to add a unit test for the JS part that you added.
Flags: needinfo?(yzenevich)
(Assignee)

Comment 15

2 years ago
That should now be it then.
Flags: needinfo?(yzenevich)
(Reporter)

Comment 16

2 years ago
Comment on attachment 8690848 [details] [review]
[gaia] ssaavedra:bugfix-1212588-keyboard-delete-role-key > mozilla-b2g:master

Tests look nice, thanks! Forwarding the review to Jan, who's the module peer.
Flags: needinfo?(yzenevich)
Attachment #8690848 - Flags: review?(janjongboom)
(Reporter)

Comment 17

2 years ago
Comment on attachment 8690848 [details] [review]
[gaia] ssaavedra:bugfix-1212588-keyboard-delete-role-key > mozilla-b2g:master

Flipping the review to Tim
Attachment #8690848 - Flags: review?(janjongboom) → review?(timdream)
Comment on attachment 8690848 [details] [review]
[gaia] ssaavedra:bugfix-1212588-keyboard-delete-role-key > mozilla-b2g:master

Looks good! Sorry for the delay.
Attachment #8690848 - Flags: review?(timdream) → review+
(Assignee)

Comment 19

2 years ago
Sorry for my lack of understanding, but what remains here before accepting the patch? Is there anything else I should do? (rebase?, anything?)
Flags: needinfo?(yzenevich)
(Reporter)

Comment 20

2 years ago
Hi Santiago, this is pretty much it. 

There's one Gij test faling with PR (not related to your changes) but we need to be green to merge. Could you close/open pull request (via Github UI), this will re-trigger our CI hook and run the tests again? 

To request the merge (since you have the r+) simply add a 'checkin-needed' in the keywords field on this bug.
Flags: needinfo?(yzenevich)
(Assignee)

Updated

2 years ago
Keywords: checkin-needed
(Reporter)

Comment 21

2 years ago
Merged https://github.com/mozilla-b2g/gaia/commit/67ff5b3ec59a3e3730b82010568a319ca283392d

Thanks Santiago!
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Reporter)

Updated

2 years ago
Keywords: checkin-needed
(Reporter)

Comment 22

2 years ago
Also let me know if you are interested in any bugs, for example bug 1097827
Flags: needinfo?(ssaavedra)
(Assignee)

Comment 23

2 years ago
That bug is already assigned.., is it ok anyway? But yes, I am interested in those.
Flags: needinfo?(ssaavedra)
(Reporter)

Comment 24

2 years ago
Should not be a problem, the assignee was not very active in the last 10m. I'll assign it to you if that's ok?
You need to log in before you can comment on or make changes to this bug.