Bug 1150373 - [Zanata-SPA] Keyboard shortcut
[Zanata-SPA] Keyboard shortcut
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
development
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.6
Assigned To: Alex Eng
Ding-Yi Chen
:
Depends On: 1174071
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-08 01:56 EDT by Alex Eng
Modified: 2015-03-19 03:10 EDT (History)
4 users (show)

See Also:
Fixed In Version: 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4044-SUCCESS-1-gb17e4e8)
Doc Type: Bug Fix
Doc Text:
Story Points: 3
Clone Of:
Environment:
Last Closed: 2015-03-19 03:10:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alex Eng 2014-10-08 01:56:45 EDT
Description of problem:

Keyboard shortcut implementation for Zanata-SPA
- Keyboard shortcut summary view (+shortcut to open the view)

- save as current save state - ctrl/cmd + s
- save as current save state and go to next - tab / ctrl/cmd + enter, enter
- save as needs work and go to next - ctrl/cmd + enter, n
- save as translated and go to next - ctrl/cmd + enter, t
- save as approved and go to next - ctrl/cmd + enter, a
- undo edit - ctrl/cmd + z (Kinda already works with default behaviour for me)
- cancel edit - Esc (When available)
- next translation - tab (Save is there is unsaved data)
- previous translation - shift + tab
Comment 1 Alex Eng 2014-12-08 00:11:02 EST
Pull request:

zanata-spa:
https://github.com/zanata/zanata-spa/pull/85

zanata-server: 
https://github.com/zanata/zanata-server/pull/648
Comment 2 Ding-Yi Chen 2014-12-08 01:54:37 EST
Tested with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-2400) 

Issues:

1. Key "?": 
  if one field got focus, it will input the character "?" instead of showing help. Seem like it is missing modifiers.

2. Key Ctrl+Shift+s:
   after press this. I have no idea how to toggle between "NeedWork" and "Translated"

3. TAB:
   If the cell was untranslated, pressing tab simply move away the focus without saving

4. Esc:
   Pressing Esc cleans the entry. however, with input methods that use Esc, this mean you cannot fix your typo without wiping out what you have done.

   Please provide options.

5. Tab U:
   Both ibus-chewing and ibus-pinyin, intercepted "U". 


6. Where is the help for rest of keyboard short cuts?
Comment 3 Luke Brooker 2014-12-08 18:58:16 EST
(In reply to Ding-Yi Chen from comment #2)

1. I knew this, but was thinking of making it only work when you are not focused. This is becoming a standard key for shortcuts. For access during translation we could have a secondary key that adds a modifier e.g. CTRL/CMD + ?. The pop-up also need categories that are hard to create with the current module.

2. These keys need to show in the menu, but currently don't because of the limits of the module we are using. I would also like to enable up and down arrow keys here and/or highlight the letter corresponding to each item.

3. This shouldn't be the case. Seems like a bug.

4. This is something that we need to get to but ran out of time. I think we will need a small dialog when they hit esc (while there is new work) to see if they would like to save, discard or cancel when hitting esc. This is not possible with the mouse because we replace the "X" with undo if there are changes.

5. Not sure what is happening here, I never encountered this problem. Is this while still holding tab?

6. As I mentioned earlier the module we use for this is not very flexible. We will work on this in the next release.
Comment 4 Patrick Huang 2014-12-09 23:13:51 EST
3. Didn't happen to me. (first remove text from a message then hit tab, it saves as Untranslated)
Comment 5 Ding-Yi Chen 2014-12-10 01:19:32 EST
(In reply to Patrick Huang from comment #4)
> 3. Didn't happen to me. (first remove text from a message then hit tab, it
> saves as Untranslated)

You were talking about Translated -> New.

I was talking about New -> Translated that failed.
Comment 6 Patrick Huang 2014-12-14 22:59:43 EST
It's not a bug in shortcut. It tries to save it but failed because revision is null. This is a problem with using fake server during development. I will fix it separately(in zanata-spa) since my original PR has been merged. Will merge the change into this PR (zanata-server)
Comment 7 Patrick Huang 2014-12-14 23:24:51 EST
Found another bug on the server. Filed a separate bug for it bug 1174071
Comment 8 Patrick Huang 2014-12-18 00:12:33 EST
you can get the artifact from this job http://zanata-build.lab.eng.bne.redhat.com:8080/job/zanata-spa-integration-build/

to test keyboard shortcuts
Comment 9 Ding-Yi Chen 2014-12-18 02:33:56 EST
Tested with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4019-SUCCESS-10-g1e5ef16)

Firefox 31.2.0

1. If the entry is on the bottom of the streen, pressing tab will switch between entry -> Save as State -> Save as "v" -> entry
   It will be easier to reproduce if use the last entry of a page.

2. Tab + U works with the input method most of the time, but not on bottom of the screen (similar to 1)

3. Please say in the shortcut panel that 
   Ctrl+ Shift +S + N "save as Need Work";
   and the actual key required to save as translated.
Comment 10 Patrick Huang 2014-12-18 21:26:57 EST
Please retest point 1 and 2 with artifact from http://zanata-build.lab.eng.bne.redhat.com:8080/job/zanata-spa-integration-build/12/

Point 3 will be addressed separately according to Luke.
Comment 11 Ding-Yi Chen 2014-12-19 02:38:35 EST
Tested with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4017-SUCCESS-12-g92f33ee)

Fedora 21 x64
Firefox 34.0
Google chrome 39.0.2171.95 (64-bit)
DE: 
   enlightenment-0.17.6-1.fc21.x86_64
Input method:
   ibus-1.5.9-5.fc21.x86_64
   ibus-chewing-1.4.14-2.fc22.x86_64
   ibus-libpinyin-1.6.92-4.fc21.x86_64

1. Shift-Tab on 1st entry of 2nd page will go out of the screen, though a few Tab will go back.

2. If 1. Happened, press Tab on last entry 1st page will sometime go out of screen, though a few Shift-Tab will go back. 
   This is not always reproducable.
 
3. Tab + U is intercepted by input methods (i.e. not working)
   Perhaps ibus version and DE play important roles here.
Comment 12 Patrick Huang 2014-12-22 17:46:52 EST
(In reply to Ding-Yi Chen from comment #11)
> Tested with Zanata 3.6.0-SNAPSHOT
> (git-jenkins-zanata-server-verify-integration-master-4017-SUCCESS-12-
> g92f33ee)
> 
> Fedora 21 x64
> Firefox 34.0
> Google chrome 39.0.2171.95 (64-bit)
> DE: 
>    enlightenment-0.17.6-1.fc21.x86_64
> Input method:
>    ibus-1.5.9-5.fc21.x86_64
>    ibus-chewing-1.4.14-2.fc22.x86_64
>    ibus-libpinyin-1.6.92-4.fc21.x86_64
> 
> 1. Shift-Tab on 1st entry of 2nd page will go out of the screen, though a
> few Tab will go back.
> 
> 2. If 1. Happened, press Tab on last entry 1st page will sometime go out of
> screen, though a few Shift-Tab will go back. 
>    This is not always reproducable.
>  

1 and 2 are designed to do that. Once they reach the end of the page, tab will de-select the last entry and page are in reading mode. Same goes to shift-tab on first entry. Eventually/ideally paging will be gone and replaced by infinite scroll. So it won't work like current editor (go to last entry on previous page or first entry on next page).

> 3. Tab + U is intercepted by input methods (i.e. not working)
>    Perhaps ibus version and DE play important roles here.

I can't do anything to disable input method interception. There are alternate shortcuts to use (the old ones). As alpha version we will see how people will use them and adjust the key shortcuts in future release.
Comment 13 Ding-Yi Chen 2014-12-22 19:15:41 EST
(In reply to Patrick Huang from comment #12)
> (In reply to Ding-Yi Chen from comment #11)
> > Tested with Zanata 3.6.0-SNAPSHOT
> > (git-jenkins-zanata-server-verify-integration-master-4017-SUCCESS-12-
> > g92f33ee)
> > 
> > Fedora 21 x64
> > Firefox 34.0
> > Google chrome 39.0.2171.95 (64-bit)
> > DE: 
> >    enlightenment-0.17.6-1.fc21.x86_64
> > Input method:
> >    ibus-1.5.9-5.fc21.x86_64
> >    ibus-chewing-1.4.14-2.fc22.x86_64
> >    ibus-libpinyin-1.6.92-4.fc21.x86_64
> > 
> > 1. Shift-Tab on 1st entry of 2nd page will go out of the screen, though a
> > few Tab will go back.
> > 
> > 2. If 1. Happened, press Tab on last entry 1st page will sometime go out of
> > screen, though a few Shift-Tab will go back. 
> >    This is not always reproducable.
> >  
> 
> 1 and 2 are designed to do that. Once they reach the end of the page, tab
> will de-select the last entry and page are in reading mode. Same goes to
> shift-tab on first entry. Eventually/ideally paging will be gone and
> replaced by infinite scroll. So it won't work like current editor (go to
> last entry on previous page or first entry on next page).

When pressing shift-Tab multiple times on 1st entry, the id (in URL) is keep decreasing. The expected behavior, according to several translation, should be stay on the first entry.

> > 3. Tab + U is intercepted by input methods (i.e. not working)
> >    Perhaps ibus version and DE play important roles here.
> 
> I can't do anything to disable input method interception. There are
> alternate shortcuts to use (the old ones). As alpha version we will see how
> people will use them and adjust the key shortcuts in future release.

Then I will make a note that Tab-U does not work with input-methods in both Linux and Windows.
Comment 15 Ding-Yi Chen 2014-12-23 01:31:38 EST
Tested with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4027-SUCCESS-2-g9db1cea)

Environment 

RHEL7.0, Gnome3, Google Chrome 33.0.1750.117
RHEL7.0, Gnome3, Firefox 31.2.0
Fedora 21, cinnamon, Firefox 34.0

1. Now each page only got 2 entries.
   Please make sure this symptom is not introduced by the bug fix.

2. On 1st entry on each page 
   Pressing  shift-Tab once input focus is disabled.
   Pressing shift-Tab again,
      Expected: no action
      Actual: Input focus jumped to 2nd/last entry (each page only got 2 entry)
Comment 17 Ding-Yi Chen 2014-12-24 00:40:20 EST
Tested with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4029-SUCCESS)

Environment 

RHEL7.0, Gnome3, Google Chrome 33.0.1750.117
RHEL7.0, Gnome3, Firefox 31.2.0


1. For both browsers: 
   On 1st entry on each page 
   Pressing  shift-Tab once input focus is disabled.
   Pressing shift-Tab again,
      Expected: no action
      Actual: It rotates amongst elements on the header, as well as URL field of browser.

2. For Firefox:
   On any entry,
   Pressing Tab
      Expected: move to next cell
      Actual: It rotates amongst elements on the header, as well as URL field of browser.

3. Pressing "previous page"
      Expect: Current page -1  (From page 4 -> page 3)
      Actual: Current page -2  (From page 4 -> page 2)

4. Pressing "next page"
      Expect: Current page +1  (From page 1 -> page 2)
      Actual: Current page +2  (From page 1 -> page 3)

Please make sure 3 and 4 are int introduce by the bug fix.
Comment 18 Patrick Huang 2015-01-04 18:23:51 EST
(In reply to Ding-Yi Chen from comment #17)
> Tested with Zanata 3.6.0-SNAPSHOT
> (git-jenkins-zanata-server-verify-integration-master-4029-SUCCESS)
> 
> Environment 
> 
> RHEL7.0, Gnome3, Google Chrome 33.0.1750.117
> RHEL7.0, Gnome3, Firefox 31.2.0
> 
> 
> 1. For both browsers: 
>    On 1st entry on each page 
>    Pressing  shift-Tab once input focus is disabled.
>    Pressing shift-Tab again,
>       Expected: no action
>       Actual: It rotates amongst elements on the header, as well as URL
> field of browser.
> 
Natural shift-tab behavior.
> 2. For Firefox:
>    On any entry,
>    Pressing Tab
>       Expected: move to next cell
>       Actual: It rotates amongst elements on the header, as well as URL
> field of browser.
> 
It moves to next cell as expected unless on last entry
> 3. Pressing "previous page"
>       Expect: Current page -1  (From page 4 -> page 3)
>       Actual: Current page -2  (From page 4 -> page 2)
> 
> 4. Pressing "next page"
>       Expect: Current page +1  (From page 1 -> page 2)
>       Actual: Current page +2  (From page 1 -> page 3)
> 
> Please make sure 3 and 4 are int introduce by the bug fix.
Can't reproduce. On Firefox 31.3.0.
Comment 19 Ding-Yi Chen 2015-01-05 00:48:12 EST
(In reply to Patrick Huang from comment #18)
> (In reply to Ding-Yi Chen from comment #17)
> > Tested with Zanata 3.6.0-SNAPSHOT
> > (git-jenkins-zanata-server-verify-integration-master-4029-SUCCESS)
> > 
> > Environment 
> > 
> > RHEL7.0, Gnome3, Google Chrome 33.0.1750.117
> > RHEL7.0, Gnome3, Firefox 31.2.0
> > 
> > 
> > 1. For both browsers: 
> >    On 1st entry on each page 
> >    Pressing  shift-Tab once input focus is disabled.
> >    Pressing shift-Tab again,
> >       Expected: no action
> >       Actual: It rotates amongst elements on the header, as well as URL
> > field of browser.
> > 
> Natural shift-tab behavior.
>
> > 2. For Firefox:
> >    On any entry,
> >    Pressing Tab
> >       Expected: move to next cell
> >       Actual: It rotates amongst elements on the header, as well as URL
> > field of browser.
> It moves to next cell as expected unless on last entry

I have asked a few translators, they did not expect that entry lost focus after press Tab on last entry or Shift-Tab on first entry.

So there are following resolutions:
a) Showing Alt-Down and Alt-Up as alternative
b) Making Shift-Tab and Tab stop at 1st entry and last entry.
c) Keep current behavior, but document the behavior.

> > 3. Pressing "previous page"
> >       Expect: Current page -1  (From page 4 -> page 3)
> >       Actual: Current page -2  (From page 4 -> page 2)
> > 
> > 4. Pressing "next page"
> >       Expect: Current page +1  (From page 1 -> page 2)
> >       Actual: Current page +2  (From page 1 -> page 3)
> > 
> > Please make sure 3 and 4 are int introduce by the bug fix.
> Can't reproduce. On Firefox 31.3.0.

Strange, I cannot reproduce it either today.


5. Pressing "Tab-u" (Input method off, keyboard layout en-US (qwerty))
     Expected: Move to next untranslated
     With firefox:
        Actual: Entry focus lost
     With Chrome:
        Actual: Move to last entry of the page, regardless whether the last entry is translated or not.
Comment 20 Ding-Yi Chen 2015-01-05 01:06:54 EST
Test cases:
 - ?
   - [ ] Press ? when unfocused
   - [ ] Press ? on new translation
   - [ ] Press ? on need work
   - [ ] Press ? Translated

 - ALT+c
   - [ ] Press ALT+c when unfocused
   - [ ] Press alt+c on new translation
   - [ ] Press alt+c on need work
   - [ ] Press alt+c Translated

 - CTRL+s
   - [ ] Press CTRL+s when unfocused
   - [ ] Press CTRL+s on new translation
   - [ ] Press CTRL+s on need work
   - [ ] Press CTRL+s Translated

 - CTRL+Shift+s
   - [ ] Press CTRL+Shift+s when unfocused
   - [ ] Press CTRL+Shift+s on new translation
   - [ ] Press CTRL+Shift+s on need work
   - [ ] Press CTRL+Shift+s Translated

 - TAB
   - [ ] Press TAB when unfocused
   - [ ] Press TAB on new translation
   - [ ] Press TAB on need work
   - [ ] Press TAB Translated
   - [ ] Press TAB on last entry

 - Shift+TAB
   - [ ] Press Shift+TAB when unfocused
   - [ ] Press Shift+TAB on new translation
   - [ ] Press Shift+TAB on need work
   - [ ] Press Shift+TAB Translated
   - [ ] Press Shift+TAB on first entry

 - Esc
   - [ ] Press Esc when unfocused
   - [ ] Press Esc on new translation
   - [ ] On new translation, alt+C, Esc
   - [ ] On new translation, type "abc", Esc
   - [ ] Press Esc on need work  
   - [ ] On need work, type "abc", Esc
   - [ ] Press Esc Translated
   - [ ] On need work, type "abc", Esc

 - TAB+u
   - [ ] Press TAB+u when unfocused
   - [ ] Press TAB+u on new translation
   - [ ] Press TAB+u on need work
   - [ ] Press TAB+u Translated
   - [ ] Press TAB+u on previous entry of translated entries, which are followed by untranslated entries.
Comment 21 Patrick Huang 2015-01-06 18:49:27 EST
According to the discussion, we now dropped tab+u as shortcut for now. Cheatsheet has been rewritten to include all keys. tab related keys are now secondary keys.

Please test http://zanata-build.lab.eng.bne.redhat.com:8080/job/zanata-spa-integration-build/20/artifact/stage/spa-fix-shortcut-goto-x-zanata-3.6.0-SNAPSHOT.war
Comment 22 Ding-Yi Chen 2015-01-06 21:05:42 EST
Failed Test cases
   - [F] Type 'abc' and Press CTRL+s on need work
      Expected: Save as Translated (as the save as "button" change to Translated when typing)
      Actual: Save as Need Work

Also note that in old editor, Ctrl+Enter means "Save as Translated" and move down.
But in new editor, Ctrl+Enter just mere move down.
Please confirm that should Ctrl+Enter "Save as Translated" before move down in new editor.


======

Revised Test cases (regarding #c21 )

 - ALT+c/ALT+g
   - [x] Press alt+g on new translation
   - [x] Press alt+c on need work
   - [x] Press alt+g Translated

 - CTRL+s
   - [x] Press CTRL+s on new translation
   - [x] Press CTRL+s on need work
   - [x] Press CTRL+s on Translated
   - [x] Type 'abc' and Press CTRL+s on new translation
   - [F] Type 'abc' and Press CTRL+s on need work
   - [x] Type 'abc' and Press CTRL+s on Translated

 - CTRL+Shift+s+t
   - [x] Press CTRL+Shift+s+t on new translation
   - [x] Press CTRL+Shift+s+t on need work
   - [x] Press CTRL+Shift+s+t on Translated
   - [x] Type 'abc' and Press CTRL+Shift+s+t on new translation
   - [x] Type 'abc' and Press CTRL+Shift+s+t on need work
   - [x] Type 'abc' and Press CTRL+Shift+s+t Translated

 - CTRL+Shift+s+n
   - [x] Press CTRL+Shift+s+n on new translation
   - [x] Press CTRL+Shift+s+n on need work
   - [x] Press CTRL+Shift+s+n on Translated
   - [x] Type 'abc' and Press CTRL+Shift+s+n on new translation
   - [x] Type 'abc' and Press CTRL+Shift+s+n on need work
   - [x] Type 'abc' and Press CTRL+Shift+s+n Translated

 - TAB   CTRL+Enter Alt+K  Alt+down
   - [x] Press key on new translation
   - [x] Press key on need work
   - [x] Press key Translated
   - [x] Press key on last entry

 - Shift+TAB Ctrl+Shift+Enter  Alt+J   Alt+up
   - [x] Press key on new translation
   - [x] Press key on need work
   - [x] Press key Translated
   - [x] Press key on first entry

- Esc
   - [x] Press Esc on new translation
   - [x] On new translation, alt+C, Esc
   - [x] On new translation, type "abc", Esc
   - [x] Press Esc on need work  
   - [x] On need work, type "abc", Esc
   - [x] Press Esc on Translated
   - [x] On translated work, type "abc", Esc
Comment 23 Patrick Huang 2015-01-06 21:39:42 EST
Original description says: ctrl+s save as current state. But I think Luke has mentioned it to save as what's appear in the save as buttons option. Same rule apply to ctrl+enter. So now ctrl-enter will not always save as translated. It will only do that when you changed a fuzzy string.
Comment 25 Ding-Yi Chen 2015-01-07 00:54:37 EST
VERIFIED with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-verify-integration-master-4044-SUCCESS-1-gb17e4e8)

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