Feature request: Keyboard shortcuts
It would be great if we could do things we do often via keyboard shortcuts.
For example:
- Cmd+Enter: Post question.
- C: Compose new question
- R: Reply
- E: Archive (mark closed for example)
- J/K: Next/previous (between threads or between posts in pages)
- N: View notifications
etc.
It would be great if it took inspiration from the same shortcuts that are used in Gmail and Intercom.
Linked from:
- KajMagnus @KajMagnus2020-04-20 04:02:37.286Z
Good idea. Nice with shortcuts. Personally I use Vim keybindings in all editors, e.g. VSCode. (Gmail's J/K is the same as in Vim.)
Related thread at HackerNews: https://news.ycombinator.com/item?id=22741386 — summary: It's about a way to quickly find all ancestor posts, so that, in large discussions, one won't need to scroll up "manually" to find all ancestors (the parent reply, grandparent, grand-garnd-... ).
— MaybeP
could be a shortcut for popping up a dialog and showing all parent posts, in long discussions? Or jumping to the parent post- CChristian Scheuer @chrscheuer
Yea, good idea!
Something that I use all the time in Intercom now is the ability to "snooze" a conversation.
Often I could need something similar in TY where I will see a post from a user, but I don't immediately have time to answer their question.
However - I don't wanna risk not answering them in the future.
In Intercom I can choose to manually "close" or "snooze" a conversation. Perhaps something similar could be implemented for the forum - although I know it has to work differently on a forum.
But would be great for time management, so that it's easier to delay less important threads and focus on more time sensitive ones. Right now I have to reply to everything I see when I see it, because otherwise I risk forgetting them.Oooops - and the reason I posted that in this thread is that I use "z" in Intercom for snoozing :)
- In reply tochrscheuer⬆:KajMagnus @KajMagnus2020-11-18 12:08:17.930Z
Ok so shortcuts will be included in the upcoming version (already implemented).
E.g.
gr
= Go to the topics list, view Recent topics,gaa
= Go to Admin Area, andcnh
= Change Notifications to Hushed notification level.If one clicks Shift (and no other key), a list of all shortcuts pops up.
There'll be a feature flag now initially, so can be enabled/disabled site wide. Maybe should be a per user feature flag too, hmm
- CChristian Scheuer @chrscheuer
Just checked it out here on the site. Very cool!
- In reply tochrscheuer⬆:KajMagnus @KajMagnus2020-11-23 09:35:29.310Z
Shortcuts now available here at Ty .io — click Shift to try them out
- CChristian Scheuer @chrscheuer
It would be great if the popup that comes up when I've changed my notification setting could be dismissed with Enter (on top of Escape).
Clicking Escape to press "Okay" feels a bit weird.
But this is so awesome progress! Thank you- CChristian Scheuer @chrscheuer
I keep pressing c, n, h here on forum.soundflow.org but it doesn't work yet.... Haha. Keep me posted on when we'll get it on our server :)
- KajMagnus @KajMagnus2020-12-03 13:20:05.163Z
I just upgraded the server so now you can enable shortcuts — if you go to your profile page, and click Preferences then the Interface tab, and then add this JSON key-value:
"kbd": 1
(there'll be a gui later).Edit: And reload the page afterwards.
Or, to enable for everyone, you can add that key-value to the Everyone group. But maybe better wait with that, until you feel happy yourself about how it works. (Maybe enable for the Core Members group?)
Actually until now (this new version, it got ready yesterday), the shortcuts were a bit annoying — they popped up too often, unintentionally. Maybe there's some more annoying thing that I didn't notice myself yet (and that you will notice or sbd else)
- CChristian Scheuer @chrscheuer
Thanks!
Let me give some quick feedback.The hold down shift to show the keyboard shortcuts is extremely annoying. I'd change this to that people would need to type a question mark – that's how it's usually done in other systems I'm using.
But the popup when holding down shift is very interrupting.When I pressed "Go to newest topics", it went here, which seems like a bug:
https://forum.soundflow.org/test/new"W" opens the left sidebar and "S" opens the right sidebar. These are undocumented.
It would be great to have a snackbar/toast (temporary message overlay that dismisses itself and doesn't need interaction) to display messages like "I did what you asked".
When I press "c, n, h" to hush the notifications, it's already better I can press Enter to "Okay" the dialog. But really, I've already told it what I wanted to happen. It shouldn't force me to another interaction.
I have a feeling this is a general thing that could be implemented site-wide, so that you limit interactions that are just saying "Yes, I did what you wanted", so we can get rid of the extra clicks.
The snackbar/toast could, IMO, be very minimal UI wise. Check out gmail for example for how they show they did what you wanted (and they then present a little Undo button on the snackbar as well). It makes much more sense UX wise IMO.- CChristian Scheuer @chrscheuer
Generally, though, this is great. I love the ability to do all this.
Perhaps there could be a delay in showing the keyboard shortcut popup when typing multi key shortcuts. When I'm pressing cnh, which I'll be doing a lot – if I'm doing it quickly enough, showing the popup for a split second looks a bit weird.
- CChristian Scheuer @chrscheuer
One other idea worth checking.
A lot of the time, my workflow when going on the forum is:- Open my notifications
- Click on each of the new notifications to check what's new in every new thread
Perhaps it could be made so that either:
a) You enable a shortcut when on a thread/page, to go to the next unread page/thread.
or,
b) You allow keyboard navigation (usually, j for previous and k for next is used), when on the notifications page, so that I could use J and K to select a notification, then Enter to open it.
- CChristian Scheuer @chrscheuer
Oops, and also: "R" to reply would be awesome :)
- CChristian Scheuer @chrscheuer
Just noticed, if I try to copy text anywhere, when holding down Cmd (on a Mac) and pressing C, then the keyboard popup will show briefly.
- KajMagnus @KajMagnus2020-12-08 04:35:44.158Z
Seems I forgot to check for
event.metaKey
, including in the upcoming version.What would R reply to? If it's a new topic — then, the original post obviously,
And maybe if one came to the page by following a reply notification link — then, the reply one got notified about, could be focused and highlighted / outlined somehow,
and clicking R would reply to that post? (i.e. the one one got notified about)could be a delay in showing the keyboard shortcut popup
Yes that'd be nice. Maybe there could be a CSS transition, so initially only a small dialog with "Typing shortcut: ..." is shown, but the whole screen won't "abruptly" change to the shortcut dialog — instead, it fades in after a second.
- CChristian Scheuer @chrscheuer
TBH, I would love for the keyboard shortcut dialog to never show up at all automatically – only show if I ask for the shortcuts help dialog. That's how it works on all other systems I've tried (Google, Gmail, Intercom, Slack).
Power users that will use this feature are users who use the forum for hours every day and so it'll mostly be an annoyance that the screen flashes. They don't need to be constantly reminded what they're doing, they already know it. If they need help, they press "?" and get it. The whole point is to not have UI.
I don't think a small dialog would help for this. It would have to be very, very, very small then, and off to the bottom or side at least. But that would be designing a feature we don't really need, IMO.- KajMagnus @KajMagnus2020-12-11 22:41:13.557Z
Oh actually when you replied, I had implemented the CSS animations already. It's a fairly small box, and the background gets dimmed with opacity just 0.1, instead of 0.5.
Now I've deployed the new version to here at Ty .io, feel free to try it out — if you click
g r
and ther
within about a second after theg
. ( & should include the Mac Cmd key fix)- CChristian Scheuer @chrscheuer
I'm still seeing the very weird behavior of the shortcut dialog coming up when I'm just holding down or pressing Shift.
That's is soooooo annoying. I really wish this could be turned off. It's almost making me disable the feature altogether.It's very often that I'll start holding down shift, in preparation for doing something else – for example typing the start of a new sentence. But also for other, normal navigation, it keeps coming up in unexpected ways.
I'll check the other behaviors now.
- CChristian Scheuer @chrscheuer
But yea – I do like the new smaller box that opens up slower, yet still provides you with some visual feedback. Great work! :)
Edit: So now it works typing the shortcuts, but there's still the issue of the box that comes up when holding shift.
- CChristian Scheuer @chrscheuer
I think the full "show me all the shortcuts" needs to:
- Only come up when you ask for it, ie. you click on a link somewhere to show you the shortcuts, or, you press "?" or some other command to show it to you.
- It needs to support scrolling. Right now, if you actually want to look through the shortcuts, the moment you start scrolling to view the rest of the shortcuts, it disappears.
The way it currently pops up out of nowhere and then isn't possible to interact with, makes it almost unusable IMO.
- CChristian Scheuer @chrscheuer
Another example of when this comes up unintentionally is every time I'm tabbing through tabs in Chrome...
- KajMagnus @KajMagnus2020-12-13 22:33:35.343Z
Ok I'll change to
?
instead of Shift to open the menu.
I got the Shift idea after having clicked Shift-Shift in IntelliJ to open a find-file shortcuts menu — but that's actuallyShift-Shift
, not Shift just once.Maybe
Shift Shift
can be a nice way to open the sortcuts menu too — in addition to?
. BecauseShift Shift
works also when one is typing in the editor — but?
would then type a literal?
.needs to support scrolling
I'll need to fix that. Didn't notice, large screen (those days).
- CChristian Scheuer @chrscheuer
I think Shift Shift would happen very often for me too.
Maybe that's something people could add themselves at a later point?
Note that none of the shortcuts work when the editor field is focused anyway, so that's really a moot point.Most shortcut solutions I've found work that way, btw. That is, when editing something, no shortcuts, then when you're not editing, all the shortcuts work.
- CChristian Scheuer @chrscheuer
If we can get the "Shift" thing away, then I'm really starting to become happy with this feature. As in A LOT.
And I'm actually happy that you did the small popup. It works great!There's still one bug, in which I press "g n" to go to newest topics, it goes to that weird test site:
https://forum.soundflow.org/test/new- KajMagnus @KajMagnus2020-12-20 19:48:06.650Z
I've fixed the
g n
problem. There was another old forum page (a Talkyard site can have different forums, but the feature is disabled) — namely the/test/
page. I deleted it. Previously, Ty didn't know which forum page to use — the real one, or the test one (now deleted).Now,
?
opens the shortcuts menu.Shift no longer opens the menu. Currently Shift Shift does (explanation below) — if it's too annoying, I could make that optional. What I'm thinking, though, is to also have shortcuts available when typing in an editor (I'm used to that from Idea and VSCode), ...
Let's say you'd like to link to a topic, whilst typing. Then, normally, you'd need to somehow navigate to that topic and copy the url. However, what about instead clicking Shift Shift to open the shortcuts, then type
L P
for "link to page" and then starting typing the table title, there's a fuzzy search and Ty finds the page, you hit enter, and have added a link.
Or maybeS
for temorarily entering scroll mode — andP
to scroll up to the parent, and refresh your mind, thenB
to scroll back to the post you were replying to ... and continue typing.
OrShift Shift /
to search for a topic, whilst typing, ... find it, hit Enter to open it in a new tab, there, read or maybe copy text (all without leaving the keyboard), then the browser's Ctrl+W to close that new tab, and you're back in the editor again, with some new text in the clipboard, or have refreshed your memory about something.- CChristian Scheuer @chrscheuer
It sounds interesting :) Maybe you're right. My immediate hunch is that it would risk causing issues for our users. It would be very often we'd end up using something like Shift Shift / (when writing code comments for example).
So if it could be made opt-in that would be great.
I can see it be very valuable though, so if there's a way to make it work without being intrusive, that would be amazing. Let's see how it works in the wild, looking forward to testing your changes :)When will they be pushed to our server?
Note, the font also seems to have changed on your forum so everything is bold now. Is that intentional?
- KajMagnus @KajMagnus2020-12-20 22:14:15.451Z
The font: A bug, I accidentally forgot a build step, when serving fonts directly from Ty, instead of from Google's CDN. So for some days it's
sans-serif
instead ofOpen-Sans
, except for at your site (your custom font).When pushed to your server: Already (earlier today).
using something like Shift Shift / (when writing code comments
Hmm don't know if it's a silly question, but for what reasons would / might they type Shift (Shift) before
/
?- CChristian Scheuer @chrscheuer
People hold down shift all the time for whatever reason. Starting to type a capital letter, etc.
"/" is very often occurring when writing Javascript code, which our users do a lot in our forum.- CChristian Scheuer @chrscheuer
Just confirming I wasn't being weird.. This just happened while I was typing a response to a user :)
- KajMagnus @KajMagnus2021-01-02 22:17:40.163Z
Now I did two changes: ( & Prod upgraded)
1) Shift-Shift now needs to be a "double click": typed within about 500 ms of each other. (500 ms is supposedly the default mouse double click in MS Win.)
(This is actually how it works in IntelliJ Idea — needs to be a "double click".)And 2) If this is still annoying, then you can change from:
{ "kbd": 1 }
to{ "kbd": 2 }
in the UI preferences (one's user profile, then "Preferences" then "Interface"). This disables Shift-Shift.- CChristian Scheuer @chrscheuer
Awesome!!
- In reply tochrscheuer⬆:KajMagnus @KajMagnus2020-12-08 04:46:50.523Z
You enable a shortcut when on a thread/page, to go to the next unread page/thread.
or,
b) You allow keyboard navigation (usually, j for previous and k for next is used), when on the notifications page, so that I could use J and K to select a notification, then Enter to open it.Yes all of this, somehow, some day.
I'm thinking about
S N N
to Scroll whithin the same page to the Next Notification to oneself. ThenS N N
again, to scroll to the next-next unread notification, and next-next-next, until one has read all new notifications to oneself, on that page.And maybe
S R
for Scrolling to the most Recent reply — if one just want to scroll through the newest replies to see what's happened, when one was away.I think
S N N
is a bit related to grouping notifications per page — in that it'd be a quick way to find all unread things on the page, also if there's just [one single notification list item] for everything new on that page:shortcut when on a thread/page, to go to the next unread page/thread
Maybe
M N N
could go to one's next unread notification? (My Next unread Notification — also if it's on a different page)
AndM N _
(space) would open one's notifications list (instead of justM N
). - Progresswith doing this idea