sparkle icon indicating copy to clipboard operation
sparkle copied to clipboard

keyboard shortcuts: are they there or todo?

Open yarikoptic opened this issue 3 years ago • 5 comments

primary use case to show/hide chat (while it is a floating one).

I see that some provisions were done already to https://github.com/sparkletown/sparkle/commit/45108f229a94d560233442ec39c7a129e8676cc1 provide support for shortcuts, but I wondered -- are any already there and it is just a matter of documentation (and having some "Help" pane) or it ended up non-trivial to support?

yarikoptic avatar May 17 '21 20:05 yarikoptic

I see that some provisions were done already to 45108f2 provide support for shortcuts, but I wondered -- are any already there

Keyboard shortcuts only exist currently for the 'grid view' of the PartyMap (when enabled), and navigating around that.

  • https://github.com/sparkletown/sparkle/search?q=useMousetrap
  • https://github.com/sparkletown/sparkle/search?q=useKeyboardControls
    • https://github.com/sparkletown/sparkle/blob/staging/src/hooks/useKeyboardControls.ts#L8-L13
    • https://github.com/sparkletown/sparkle/blob/staging/src/components/templates/PartyMap/components/Map/Map.tsx#L174-L180

and it is just a matter of documentation (and having some "Help" pane) or it ended up non-trivial to support

It's fairly easy to add new keyboard shortcuts in general, though we would need to be mindful about what is used, where they are added, the scope they apply to, and ensuring they are documented well/etc.

Personally I quite like the model/look of GitHub's ? shortcut for help: image

0xdevalias avatar May 17 '21 23:05 0xdevalias

yeah, I like github's too but probably we wouldn't be in time to add as extensive one. my immediate desire would be c - toggle Chat, s - toggle Schedule . If there is f - focus in Search bar would also be handy. There could also be C - focus in Chat (might need 2-3 extra lines ;)) which would not only ensure that chat pain is visible, but that focus moves to the message edit box.

Those are AFAIK relevant on most if not all screens.

yarikoptic avatar May 18 '21 14:05 yarikoptic

ok, a working prototype with some gotchas is in https://github.com/sparkletown/sparkle/pull/1416

yarikoptic avatar May 18 '21 15:05 yarikoptic

yeah, I like github's too but probably we wouldn't be in time to add as extensive one.

@yarikoptic Yup, agreed. Was more sharing for the type/style of the ? help menu modal, rather than suggesting we should implement as comprehensive a collection of shortcuts right now.

0xdevalias avatar May 19 '21 02:05 0xdevalias

migrated to zenhub, check!

mobilevinay avatar Jun 28 '21 13:06 mobilevinay