elk-zone / elk

A nimble Mastodon web client
https://elk.zone
MIT License
5.45k stars 561 forks source link

keyboard shortcuts #39

Open danielroe opened 1 year ago

danielroe commented 1 year ago

like default mastodon ui + twitter, we can implement shortcuts, e.g. g - n goes to notifications, g - h to home, etc.

sxzz commented 1 year ago

I prefer to use keyboard shortcuts + hover. For example, I can use a trackpad to move the cursor to a post and press some key (like f), to favorite the post.

ayoayco commented 1 year ago

Will this also add Twitter's 'j' / 'k' hotkeys to go down and up your timeline?

hartmut-co-uk commented 1 year ago

I prefer to use keyboard shortcuts + hover. For example, I can use a trackpad to move the cursor to a post and press some key (like f), to favorite the post.

👍 as an example -> Linear.app provides such shortcuts + hover as well

hartmut-co-uk commented 1 year ago

refs

hartmut-co-uk commented 1 year ago

I'd be interested in taking this, do we (want to) have a DoD? Also what about the UI/UX aspects? And the list of shortcuts we want to support in a first iteration? Or just take it, start with a POC and see where this goes?

hartmut-co-uk commented 1 year ago

Plan of action, as a first iteration:

  1. add 'Keyboard Shortcuts' modal with instructions
    • open via ? -> shift + ?
    • close modal via shift + ? / esc
  2. add first basic shortcut
    • n / c Compose
  3. add first two sequence navigation shortcuts:
    • g..h Open Home Timeline
    • g..n Open Notifications
  4. use I18n (started off with en-US for prototyping)
forestsystem commented 1 year ago

Thank you for working on this, Hartmut!

I would love to have the option to use keyboard shortcuts. If possible, maybe Elk could improve on Mastodon's functionality, unless there's a reason not to: Mastodon's "j"/"k" keyboard shortcuts to move up and down tweets are pretty much unusable for me. The selected post goes at the bottom of the screen, partially but not completely hidden. This means I only see the bottom of the post above it if it's long. And I use this feature on Tumblr and Twitter mostly to skim more quickly, so it's super unhelpful to have posts jumping around, instead of the top of each post showing up in the same place. :(

It would be really cool for me if Elk did Tumblr/Twitter's version, instead of Mastodon's version!

AmeliaBR commented 1 year ago

If possible, maybe Elk could improve on Mastodon's functionality

Agreed. The current Mastodon web implementation of keyboard navigation is very broken & should not be used as a template:

Last I checked, Twitter was pretty good at this (but who knows, it may have broken since). Facebook as well (except that it's easy to end up with focus in a reply box and type "jjj" trying to scroll!).

I would also suggest that you plan for customizable shortcuts from the beginning (i.e., use a dynamic internal map to connect keys with action), so that you can support other languages & keyboard layouts.

You'll also want to work with some screen reader devs to make sure the custom keyboard handling is correctly communicated to the screen reader (which have their own shortcuts).

boehs commented 1 year ago

Recieved request for z for zen mode #1642

leedo commented 1 year ago

I'm a huge fan of Elk and also keyboard shortcuts :) It would be awesome to have j / k for navigating to next / prev message. I understand these may not be intuitive choices for most, but it seems fairly common in microblogging platforms.

hartmut-co-uk commented 1 year ago

Hi everyone, I'm planning to pick this up again. j / k navigation actually is a big challenge to make it work with vue-virtual-scroller.

I'll add z for zen mode to the list.

Please refer to https://github.com/elk-zone/elk/pull/319 for technical discussions.