Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard controls #2599

Open
11 tasks
codebykat opened this issue Jan 27, 2021 · 1 comment
Open
11 tasks

Keyboard controls #2599

codebykat opened this issue Jan 27, 2021 · 1 comment
Labels
[feature] shortcuts Anything related to shortcuts
Milestone

Comments

@codebykat
Copy link
Member

codebykat commented Jan 27, 2021

Internal project link: p2XJRt-2DE-p2

Keyboard Control

  • Panel navigation using arrow keys

The arrow keys can be used to navigate between the visible panels of the app (Tags, Notes List, Editor). While the editor is focused, Cmd/Ctrl + Enter can be used to move focus back to the notes list.

  • Tab to cycle between visible panels

n.b. This note is for the Mac app but this does not work here either.

The tab key should be used to select the next responder in the Mac app which currently does not work. Tab or Shift + Tab should cycle between the search field and all visible panels. Search > Tags List > Notes List > Editor which is quite typical for a Mac app.

(With the caveat that we do expect the editor to capture tabs and arrows within the editing context)

  • Develop a better idea of what is currently focused, as mentioned here.

we should maybe formalize the rules for changing focus and then see if a more elegant solution drops out. maybe there's some global (Redux) state value tracking what context we're in that changes when we enter or blur the search field…

Keyboard shortcuts

  • Shortcut updates

Remove "Toggle focus mode" shortcut Ctrl+Shift+F. Change search shortcut to Ctrl+Shift+F. Merge “Toggle Focus Mode” and “Toggle Notes List” into one shortcut.

  • Support browser-conflicting shortcuts in Electron build where possible.

I'd like to go through and check which of the shortcuts we can use on Electron despite them having another use in browser, and add them as "shadow" shortcuts that match the app shortcuts, though they won't be the primary shortcut on Electron/web.

One example is Ctrl+N which creates a new browser window, but I believe we should be able to map it to create a new note when in the Electron app.

  • Add tracks events to all keyboard shortcuts

Add a tracks event named spweb_shortcut_used with a shortcut property corresponding to the shortcut:

focus_mode, focus_search, search_next, search_previous, tag_list, open_previous_note, open_next_note, toggle_note_tag_editing, note_list, create_note, markdown, toggle_checklist, cycle_visible_panels, information_sheet, history_sheet, share_sheet

Keyboard Optimisation

  • Saving cursor position

Already implemented, but seems to be bugged on long notes: scroll position is restored but editor seems to lose focus.

We should also save cursor positions across sessions.

If the notes list is in focus then typing will automatically start a search.

@codebykat codebykat added this to the 2.7.0 milestone Jan 27, 2021
@codebykat
Copy link
Member Author

codebykat commented Jan 29, 2021

Doing some research, found this incidental info:

Tab Trapping

By default, pressing Tab in an editable editor inserts the Tab character (or spaces depending on the indentation setting) and does not navigate to the next focusable element on the page. You can toggle the trapping of Tab with Ctrl+M on Windows and Linux and with Ctrl+Shift+M on OSX, and subsequent Tab keys will move focus out of the editor.

You can also toggle Tab trapping from the Command Palette with the "Toggle Tab Key Moves Focus" action.

https://github.com/Microsoft/monaco-editor/wiki/Monaco-Editor-Accessibility-Guide

https://github.com/Microsoft/monaco-editor/wiki/Accessibility-Guide-for-Integrators

That first page also has some info I don't totally grok around how screen readers work with the editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[feature] shortcuts Anything related to shortcuts
Projects
None yet
Development

No branches or pull requests

2 participants