nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.41k stars 4.07k forks source link

Keyboard shortcut support #1444

Open eppfel opened 8 years ago

eppfel commented 8 years ago

A few apps have awesome keyboard shortcuts, which makes it super easy and fast to use nextcloud. I think we should define standards for nextcloud, so the shortcuts are consistent.

Additionally It would be nice to have a current shortcut overview help like github does it. (Try it by pushing the ? key) Could this work as an app?


Keyboard shortcuts proposal

Advised general shortcuts

Shortcut Action
r Reload messages / feed
▶︎ / j / n Next item / file
◀︎ / k / p Previous message / item / file
del Delete message
o / enter open Item
q Focus internal search
u Toggle read/unread
s Toggle Star (flag) message
c create item
esc close menu

Items can be mails, files, folders, etc., if not stated otherwise

Shortcuts/combinations that should be avoided

Undecided shortcuts from News App

Maybe to special to generalize them

Shortcut Action
e expandItem
i / l toggleStar
h toggleStar && scrollToNextItem
f nextFeed
d previousFeed
c previousFolder
a scrollToActiveNavigationEntry
v nextFolder
shift + a markAllRead

Keybaord shortcuts: actual state

Files App

Shortcut Action
ctrl/cmd + n new folder
ctrl/cmd + shift + n new file
esc close menu (while new file context menu is open)
up/down select file/folder
enter open file/folder
delete/backspace delete file/folder
ctrl/cmd + f focus search field
esc close menu

Mail App

Shortcut Action
r Reload messages
◀︎ Previous message
▶︎ Next message
s Star (flag) message
u Toggle read/unread
del Delete message

News App

Shortcut Action
j / n / ▶︎ scrollToNextItem
k / p / ◀︎ scrollToPreviousItem
u toggleUnread
e expandItem
s / i / l toggleStar
h toggleStar && scrollToNextItem
o openLink
r reloadFeed
f nextFeed
d previousFeed
c previousFolder
a scrollToActiveNavigationEntry
v nextFolder
q Focus search
shift + a markAllRead

Todo:

MariusBluem commented 8 years ago

...to make something great again also reminds me on this nice guy with the fancy haircut 😜

eppfel commented 8 years ago

@ChristophWurst Could you post/link the mail shortcuts?

ChristophWurst commented 8 years ago
Shortcut Action
r Reload messages
◀︎ Previous message
▶︎ Next message
s Star (flag) message
u Toggle read/unread
del Delete message
eppfel commented 8 years ago

So, I just started implementing a proof-of-concept app for this "keyboard shortcut helper". Github uses facebox, which was not maintained for years. Are there modals in nextcloud? The only one I can think of, is in the first run wizard.

And what other apps besides mail use shortcuts, yet? I am not aware of any other. Maybe we postpone this, until our Design Guide is ready.

MorrisJobke commented 8 years ago

Are there modals in nextcloud? The only one I can think of, is in the first run wizard.

There are, but they build on an old version of jQuery UI and we try to get rid of this. Beside that these are dialog based modals (with buttons to accept or decline the stuff).

eppfel commented 8 years ago

I found the shortcuts of the files app, but not any other ones. ⏫ I'll open respective issues in the contacts/calendar/gallery apps. Any other apps that are essential?

Before we jump into action (see todos ⏫ ), we should develop an ideal/desired state, so shortcuts are consistent over apps and we don't have conflicts/collisions between apps and general shortcuts (navigation/search). I'd like @nextcloud/accessibility opinion on this, too.

phsc84 commented 8 years ago

In IE11 none of the above listed "Keyboard shortcuts: actual state" worked in the Files app on Nextcloud 10.0.1. Is this an IE11 problem or do I something wrong?

Nevertheless, I'm not sure, if backspace should trigger the "delete file/folder" action. This could lead to unintentionally deleted files (ok, we have a trashbin, but it still can be annoying).

Edit: Just tried in Chrome and the same as with IE11: none of the shortcuts worked...

eppfel commented 8 years ago

@phsc: mh, movin in the list and open works on my side, but not the rest. Maybe this is something for a dedicated issue.

jancborchardt commented 8 years ago

Also cc @BernhardPosselt as the News app was the first app with shortcuts like this. @BernhardPosselt can you post the list of the News app shortcuts?

Where do we have further shortcuts? cc @georgehrke @raghunayyar @tcitworld for Calendar, @Henni @irgendwie for Contacts & Notes, @oparoz for Gallery.

skjnldsv commented 8 years ago

@jancborchardt don't think we have shortcuts on contacts.

ccoenen commented 8 years ago

Regarding the suggestions in the original post: I'd not overwrite Ctrl+N it's a browser default for new window in all browsers I know. Ctrl+Shift+N is "get back the most recently closed window" at least in firefox. Some browsers also prevent you from overriding their shortcuts. This is the Case for Ctrl+R in either chrome or firefox, it applies to Ctrl+N in firefox.

up/down keys should only be touched if we're 100% positive that we do not break scrolling along the way. I guess this is why most apps default to vi-style move keys.

I am also against overriding Ctrl+F - personally I use in browser text search all the time also in Nextcloud. Wouldn't want to lose that. (Edit: turns out I didn't use it in Nextcloud, yet, as it's already overridden)

ccoenen commented 8 years ago

Backspace is also a bad choice for shortcuts. It is "back" in all the browsers I know. At least on windows.

eppfel commented 8 years ago

@ccoenen So far, we just collected the current state. I can only agree with your points (although Chrome has dropped backspace for cmd+◀︎, but del is sufficient for us)

I suggest working on the basis of the News/Mail App: Check if the user is not in an input/textarea/... and only then perform actions on key inputs (mainly) without modifier keys.

I made a proposal in the OP, please review: @nextcloud/accessibility @nextcloud/designers

ChristophWurst commented 8 years ago

https://github.com/nextcloud/mail/blob/52810c7b799304a7cf116abc8b13d0a4973110c0/js/views/foldercontent.js#L155-L199 is where we handle our keyboard shortcuts.

eppfel commented 8 years ago

@nextcloud/designers I know everyone is down, because of the guy with crazy hair being president and all, but I need some feedback on my proposal, so we can make dedicated PRs: So, What do you think?

Advised general shortcuts

Shortcut Action
r Reload messages / feed
▶︎ / j / n Next item / file
◀︎ / k / p Previous message / item / file
del Delete message
o / enter open Item
q Focus internal search
u Toggle read/unread
s Toggle Star (flag) message
esc close menu

Items can be mails, files, folders, etc., if not stated otherwise

Shortcuts/combinations that should be avoided

I'm not 100% on q and s though. s could be search, too.

What do you think about shortcuts for jumping between navigation (sidebar/apps/...)?

Any use-cases we need to add?

ccoenen commented 8 years ago

f could be "find" -> focus search

tyrylu commented 8 years ago

I am only a little bit worried about interactions between del and focused edit controls. It will probably be okay, but do not forget to test this.

eppfel commented 8 years ago

f could be "find" -> focus search

Another contender. 😄 The News app uses f for next Feed already, but makes sense, because ctrl + f is well known.

I am only a little bit worried about interactions between del and focused edit controls. It will probably be okay, but do not forget to test this.

If you refer to text modifications: These commands should not work, if the user is inside an input field. I guess we could even introduce esc to exit a field.

BernhardPosselt commented 8 years ago

BTW, lets not override ctrl + f, discourse does it and I hate it with a burning passion

eppfel commented 8 years ago

@BernhardPosselt, I cite my proposal 😁

Shortcuts/combinations that should be avoided

  • Combinations with ctrl and cmd in general
MorrisJobke commented 8 years ago

BTW, lets not override ctrl + f, discourse does it and I hate it with a burning passion

Press ctrl + f a second time and you get the one of the browser :wink:

mammuth commented 7 years ago

The "Advised general shortcuts" might also state a common combination for creating items.

I would like to suggest C (create/compose) (create event, compose mail, create file/folder).

This is also the shortcut which is used at eg. mail.google.com, inbox.google.com and calendar.google.com

jancborchardt commented 7 years ago

cc @ChristophWurst @georgehrke for that »Create/Compose« shortcut. We should add that to Mail and Calendar. :)

BennyLi commented 7 years ago

Just to mention it: I'm very familiar with Vim keybindings. Google uses these in there web apps too. I would prefer these type of keybindings.

In example for searching just press / and start typing. You already use the movement keys from Vim like keybindings.

ccoenen commented 7 years ago

/ for search is very limited to the nerd demographic. I believe we're better off with Ctrl+F. On many (most?) keyboards / is not even preferable to Ctrl+F, as you have to press the same amount of keys.

jancborchardt commented 7 years ago

Yup, what @ccoenen said. Additionally we use a lot of "Vim" style shortcuts already, like j/k in the News app and others.

eppfel commented 7 years ago

Thinking about this again, we should really look for other web applications and find the most used versions... Our chances of users adapting keyboard interaction, will increase if they can use the ones they already know.

jsalatiel commented 7 years ago

I dont know if this is the right place to ask, but why page up and page down does not scroll the files ?

ccoenen commented 7 years ago

one more suggestion: Alt+Up is used in Windows explorer and Gnome's nautilus to bring you up one level in your directory hierarchy (which is not always the same as browser back, so it proves very useful sometimes).

ccoenen commented 7 years ago

@jsalatiel This should work (For me, it does on Nextcloud 12, Firefox, Windows, German keyboard).

So this sounds more like a bug than missing support. I'd open this as a new ticket, this will be easier to debug and receive attention. In here nobody will ever find it.

jsalatiel commented 7 years ago

@ccoenen , thanks! i did that https://github.com/nextcloud/server/issues/6863 Well, i tested both firefox 56 and chrome 60 on linux, and neither can scroll using keyboard. (It only works with the mouse) I don't have MS Windows to test it.

siccovansas commented 3 years ago

@skjnldsv just merged the very useful functionality to tag multiple selected files at once in #28133 which closes #10674 🎉💛 !

A great addition to this would be to have keyboard shortcuts so you can quickly navigate files using up and down arrows to (de)select files. I must say that Gmail's keyboard shortcuts work really well (see this page for all its keyboard shortcuts). On a daily basis I use the up and down arrows to (de)select emails and use 'l' to add a label(/tag) or '#' to delete the selected emails. Such keyboard shortcuts would make Nextcloud Files much more powerful as you can quickly organize your files using only your keyboard.

For other reference, see the keyboard shortcuts that Signal uses.

skjnldsv commented 3 years ago

I think having this would be nice, but would require a proper API for every app to register a list of said shortcuts. So they are consistent across Nextcloud

If anyone wants to draft an RFC with a proposal, it would be cool :) This thread is a bit messy :see_no_evil: