runbox / runbox7

Runbox 7 web app
Other
127 stars 24 forks source link

Add keyboard shortcuts #44

Open gtandersen opened 5 years ago

gtandersen commented 5 years ago

Add keyboard shortcuts for common navigation and message actions.

Ref: https://community.runbox.com/t/keyboard-shortcuts-esp-vim-style-shortcuts-like-gmail-has/701

gtandersen commented 5 years ago

Suggested keystrokes:

gtandersen commented 5 years ago

Further suggestions from https://community.runbox.com/t/keyboard-shortcuts-esp-vim-style-shortcuts-like-gmail-has/701/3:

  1. Tooltips when hovering over buttons/controls, so that the user can discover the shortcuts. This would be better than simply having a list of them posted somewhere on the site (and requires less memorization!)
  2. It would be nice to have the OPTION (key word) to disable/modify single-key shortcuts (perhaps requiring Shift for the initial press) to avoid unintentional actions. I would hate to be resting my fingers on the keys, only to have a message vanish and have to go looking for it.
  3. The option to disable shortcuts entirely, for those who decide they don’t want them.
  4. If customization is possible, the ability to disable selected shortcuts. (In particular, I hate Send shortcuts involving Enter. While it may be partially attributable to my physical disability, I sometimes find that I was pressing Ctrl without noticing it, and when I press Enter to add a new paragraph, the message gets sent prematurely and unexpectedly.)
MimaIsAwesome commented 4 years ago

Hello, i would like to try this issue if i may but this will be my first issue ever so i may have some further questions :)

tadzik commented 4 years ago

Awesome! Go ahead, and feel free to ask as much as you need :)

MimaIsAwesome commented 4 years ago

Thanks! My very first question is if i should do it from scratch or may i use some third party opensource library like f.e. https://www.npmjs.com/package/angular-hotkeys?

tadzik commented 4 years ago

I think it's more sensible to go for an off-the-shelf library, at least at first – at the very least they make it easy to prototype and determine if we need anything more sophisticated.

The one you linked seems to be for AngularJS though. This one seems to be working for Angular 2+, which is the one we are using.

MimaIsAwesome commented 4 years ago

Hello! I managed to do gi, gt, j and k keyboard shortcuts. But i have some questions about others:

-"gs" is the same dilema as "e" i guess

Thank you for respond and patience! :)

gtandersen commented 4 years ago

Hi @MimaIsAwesome and nice going!

Perhaps we could use i as a shortcut for Inbox, and g followed by the first letter(s) of other foldernames to select those folders?

-- Geir

MimaIsAwesome commented 4 years ago

Hello :) This is my assignment from school and i suppose to send pull request and i am already after deadline so if you are okey with it, i would like to do a PR for work that i already done, and for the other matters i will look on it a bit later. Is it okey?

gtandersen commented 4 years ago

@MimaIsAwesome Sure thing, open a new PR and we'll have a look right away!

MimaIsAwesome commented 4 years ago

Okey, i did, but i have trouble with policy, unit and build and im not quite sure why

gtandersen commented 4 years ago

@MimaIsAwesome The policy error might be caused by a previous commit message that didn't pass, and should be fixable using these instructions: https://github.com/runbox/runbox7/wiki/Tips-&-Tricks#travis-ci-complains-the-commit-messages-are-in-the-wrong-format

tadzik commented 4 years ago

Hey, great work on the shortcuts :) Works like a charm when I tried it.

I replied to your PR with the changes required to make it pass. If you're already past the deadline and you need to focus on other things, let us know – we can take it from here and fix the build for you. If you want (and have time) to tackle the CI issues though, go ahead – and let us know if you have any further questions. The process is a bit intimidating but you've already done the hard part – now just the boring part remains :P

vertigo220 commented 4 years ago

Not sure if it's possible, but customization is always best. One person's preferred shortcuts may seem completely unintuitive to another and vice-versa. Perhaps there should be a place in the settings where all the possible actions are listed and the user can specify what key, or key combo (e.g. Shift/Ctrl/Alt+) should be used for each action.