Issue 2815: [usability] well-known browser keyboard shortcuts redefined in web UI
Status:  Released
Owner: ----
Closed:  Apr 2015
Reported by jan.uwe....@gmail.com, Aug 5, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: 2.9

What steps will reproduce the problem?
1. open the gerrit web UI using Firefox and navigate to a proposed change
2. press F5
3. Topic text field opens

What is the expected output? What do you see instead?

expected: browser page reload

Please provide any additional information below.

gerrit redefines some well-known browser shortcuts (like F5 in this case). This is counter-intuitive, default keyboard shortcut values should not re-purpose established browser shortcuts.

More examples:

- Ctrl + and Ctrl - (zoom in/out) no longer work as expected in the diff view 
- Ctrl F opens a re-implemented search on page dialog which does not have the ability to jump to next/previous search match (as far as I can see)
Aug 5, 2014
#1 jan.uwe....@gmail.com
correction regarding Ctrl F:

I found out I need to set the "Render" preference to "Slow" to make search within the whole file work, see https://gerrit-documentation.storage.googleapis.com/Documentation/2.9/user-review-ui.html#key-navigation


Aug 25, 2014
#2 ulrich.h...@gmail.com
Also, browser shortcuts like Ctrl-T to open a new tab are sometimes blocked, with is VERY annoying.

Since effectively Gerrit distroys crucial existing browser functionality I use all the time, I would never categorize this as issue as minor, but well, it's not my software is it.
Sep 23, 2014
#3 pkrasimi...@gmail.com
May I add Ctrl+w and Ctrl+left/right_arrow to the key combinations that shouldn't be redefined?  Also bump prio pls, this issue is Major annoyance.
Sep 23, 2014
Project Member #4 edwin.ke...@gmail.com
(No comment was entered for this change.)
Labels: -Priority-Minor Priority-Major
Sep 23, 2014
#5 pkrasimi...@gmail.com
A quick solution would be a checkbox in Settings:

(/) "Enable keyboard shortcuts"
Sep 23, 2014
Project Member #6 edwin.ke...@gmail.com
Well, the problem is that nobody knows why these keyboard shortcuts do not work as expected in Firefox. If we would know how to implement "Enable keyboard shortcuts" we could just fix it without this setting.
Sep 23, 2014
#7 jan.uwe....@gmail.com
note that this is not a problem specific to a certain browser.

Ctrl +, Ctrl - do not work in Chrome either (Chrome 37.0.2062.120 m , Windows 7 64 bit).

also note that behaviour depends on current focus (which makes the problem even more annoying)

e.g. using Chrome on a diff view page, if you click on the text under review , and then use Ctrl+ or Ctrl-, nothing happens. If you click on the footer on the bottom of the diff page, Ctrl+,Ctrl- zooms in/out as expected.

Probably the behaviour in other browsers and for other shortcuts and gerrit views also depends on focus.
Sep 23, 2014
#9 jan.uwe....@gmail.com
another example in Chrome:

in a diff view, focus on the text (right or left), then hit ? ->  javascript regexp search dialog opens

focus on the bottom of the diff view, hit ? -> keyboard shortcut help is displayed
Sep 23, 2014
#10 jan.uwe....@gmail.com
I can confirm Ctrl-T is blocked in Firefox when the focus is on the text in the diff view. It works when the focus is on the bottom or top of the page.
Sep 23, 2014
#11 pkrasimi...@gmail.com
Edwin mentioned Gerrit uses CodeMirror and that's what's causing problems.  Its key bindings are here: http://codemirror.net/doc/manual.html#commands
Oct 1, 2014
#12 jan.uwe....@gmail.com
I dont' find a default CodeMirror binding for F5 nor Ctrl+/Ctrl- on http://codemirror.net/doc/manual.html#commands
Feb 13, 2015
#13 roland.i...@gmx.de
I once used http://www.openjs.com/scripts/events/keyboard_shortcuts/ to implement shortcuts, and it worked quite well. Maybe you could try that?

Mar 9, 2015
#14 denis....@eclipse.org
Our users are seeing this too.  A greasemonkey script is available here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=461313
Mar 12, 2015
Project Member #15 huga...@gmail.com
https://gerrit-review.googlesource.com/#/c/66190/
Status: ChangeUnderReview
Mar 12, 2015
#16 sschuberth
I'd like to point out that #15 *only* addresses the F5 issue. All Ctrl + <key> shortcuts mentioned in this issue will not be fixed by this.
Mar 12, 2015
Project Member #17 huga...@gmail.com
I did not read the issue carefully, I am setting the status back to started. I will ask Hector to look if the other Ctrl + <key> are cause by the same problem as F5.
Status: Started
Mar 13, 2015
#18 oswcab
All the shortcuts mentioned in this issue are fixed in 2.11, except F5 which is addressed in this patch. Ctrl-F has been intentionally redefined in the new Diff screen (see #1).
Mar 13, 2015
Project Member #19 huga...@gmail.com
(No comment was entered for this change.)
Status: ChangeUnderReview
Mar 31, 2015
Project Member #20 huga...@gmail.com
Changed was moved to stable-2.11 branch: https://gerrit-review.googlesource.com/#/c/66750/
Apr 7, 2015
Project Member #21 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.11
Apr 16, 2015
Project Member #22 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Released