feat: add keyboard shortcuts #649

Merged
Kieran merged 2 commits from fernandoporazzi/snort:scroll-up-shortcut into main 2023-10-11 18:25:12 +00:00
Contributor

Twitter has some keyboard shortcuts I make use of sometimes. Maybe it's nice to have it on Snort too.

I implemented 3 of them.
n = opens new post form
s = focus on the search input
. = scroll to the top of the page

The hook I created is quite easy to reason about and with it we can add even more shortcuts when needed.

I feel like it would be cool to document the possibilities and capabilities of Snort somewhere, maybe under a new url(snort.social/settings/about)??

Twitter has some keyboard shortcuts I make use of sometimes. Maybe it's nice to have it on Snort too. I implemented 3 of them. `n` = opens new post form `s` = focus on the search input `.` = scroll to the top of the page The hook I created is quite easy to reason about and with it we can add even more shortcuts when needed. I feel like it would be cool to document the possibilities and capabilities of Snort somewhere, maybe under a new url(`snort.social/settings/about`)??
fernandoporazzi added 1 commit 2023-10-10 21:33:50 +00:00
continuous-integration/drone/pr Build is failing Details
b0d84779c8
feat: add keyboard shortcuts
fernandoporazzi added 1 commit 2023-10-10 21:37:44 +00:00
continuous-integration/drone/pr Build is passing Details
5d137f281f
solve conflicts
Owner

Yes on the about page, it would also be good to put a changelog in code so people can see what is changed and what version of snort they are using

Yes on the about page, it would also be good to put a changelog in code so people can see what is changed and what version of snort they are using
Owner

ref: #195

ref: #195
Kieran reviewed 2023-10-11 08:56:20 +00:00
@ -500,1 +500,4 @@
}
export function isFormElement(target: HTMLElement): boolean {
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {
Owner

what about select

what about `select`
Author
Contributor

I thought about it... Actually this is the complete list of form elements:

<input>
<label>
<select>
<textarea>
<button>
<fieldset>
<legend>
<datalist>
<output>
<option>
<optgroup>

Shall we support them all?

I thought about it... Actually this is the complete list of form elements: ``` <input> <label> <select> <textarea> <button> <fieldset> <legend> <datalist> <output> <option> <optgroup> ``` Shall we support them all?
Owner

Probably ok for now

Probably ok for now
Kieran merged commit 5360c5ad3b into main 2023-10-11 18:25:12 +00:00
Kieran deleted branch scroll-up-shortcut 2023-10-11 18:25:12 +00:00
Sign in to join this conversation.
No description provided.