elk icon indicating copy to clipboard operation
elk copied to clipboard

feat: keyboard shortcuts

Open hartmut-co-uk opened this issue 1 year ago • 20 comments

implements https://github.com/elk-zone/elk/issues/39

TODOs

  • [x] MVP
    • [x] add 'Keyboard Shortcuts' modal with instructions
      • [x] open via ? -> shift + ?
      • [x] close modal via shift + ? / esc
    • [x] add first basic shortcut: c for 'Compose'
    • [x] add first two sequence navigation shortcuts:
      • [x] g..h Open Home Timeline
      • [x] g..n Open Notifications
    • [x] technical details
      • [x] enable/disable based on isAuthenticated status
      • [x] disable when focused on INPUT/TEXTBOX/contenteditable
    • [x] Toot active/open(?/hover?) specific actions
      • [x] Favourite f
      • [x] Boost b
    • [x] navigate timeline prev/next status
      • [x] Next status j
      • [x] Prev status k
    • [x] styling & design
      • [x] basic design 'Keyboard Shortcuts' modal
      • [x] responsive
  • [x] define list of shortcuts to provide with this PR (limited number for a first iteration?)
  • [x] use I18n (started off with en-US for prototyping)
  • [ ] define next steps / create follow-up issue(s)

Options for improvement

  • [ ] performance / ressource utilization
    • [ ] disable event listeners for mobile devices (without hardware keyboard)
  • [ ] UI/UX
    • [ ] for page navigation (e.g. g .. h / g .. n) show a notification message ~"Going to home" by @edimitchel
  • [ ] code / architecture
    • [ ] simplify / find better solution for j/k navigation. Current solution uses DOM & querySelectors, hard to maintain / comes with high risk of regressions while working on other features..
    • [ ] export composables for each keybinding, components self-register triggers, centralised tracking of listeners (ref discord) by @QiroNT

hartmut-co-uk avatar Dec 03 '22 20:12 hartmut-co-uk