chatbox
chatbox copied to clipboard
feat: add cmd+l and ctrl+l keyboard shortcut
praise: wanted this really bad. Hope this gets implemented
I really like this PR, it's amazing! 😍😍 I can't believe I didn't think of doing this earlier. I do have a small question though - I noticed that the shortcut key in actual use is Ctrl+L, and it seems to be the same in the code. I'm just a bit confused as to why Ctrl+L was chosen as the shortcut key. Could you please help me understand the reasoning behind this?
I really like this PR, it's amazing! 😍😍 I can't believe I didn't think of doing this earlier. I do have a small question though - I noticed that the shortcut key in actual use is Ctrl+L, and it seems to be the same in the code. I'm just a bit confused as to why Ctrl+L was chosen as the shortcut key. Could you please help me understand the reasoning behind this?
I've copied the "Jump to address bar" shortcut from Chromium. Chrome uses ctrl as the modifier key on Windows+Linux, and cmd as the modifier on Mac. I've included both versions to remain intuitive to users across platforms.
Thank you for your quick response. I was wondering why the "L" key was chosen, but now I think I have an answer. In Chrome's "Jump to address bar" shortcut, "L" is easily associated with the word "Link" and the address bar, which makes it easy to remember. Regarding Chatbox, I think selecting "I" for the input box might be more suitable, as it would be easily associated with the word "Input" and the message input box. Of course, this is just my personal opinion, and I would love to hear any other suggestions you may have.
I'm not super attached to L, I'm happy to update it to whichever we feel is best.
I think it would be wise to stick to a combination that's pretty standardized. Cmd+L makes sense for link, and I can see how we wouldn't want to use it if this ever lives in a browser.
Some other options I considered was Cmd+K for Kommand (obviously Cmd+C is reserved) that other apps like Slack, VSCode, and Vercel use.
Or another option I've seen used is just a single / key.
Thank you for the patient discussion. I'd like to merge this PR as soon as possible. However, I would like to make a minor modification that I hope you can understand. For now, I still prefer to use Cmd+I as the shortcut key for the input box, and plan to keep Cmd+K for global search. Overall, this is a great PR, and I appreciate your contribution.