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

Editor focus and unfocus hotkeys #12828

Closed
systimotic opened this issue Jan 25, 2017 · 11 comments
Closed

Editor focus and unfocus hotkeys #12828

systimotic opened this issue Jan 25, 2017 · 11 comments
Assignees
Labels
scope: UI Threads for addressing UX changes and improvements to user interface status: discussing Under discussion threads. Closed as stale after 60 days of inactivity.

Comments

@systimotic
Copy link
Member

Issue Description

In the switch to React, it seems like a lot features were lost. I fixed one of those previously (#11329), and now I found another one: #8241

I found this because I was searching issues about unfocusing the editor as suggested on the forum here. I ran into this myself previously, and I feel this would be a great addition. It's really annoying to have to grab the mouse to be able to the keyboard 😅

I managed to implement both of these, so if we agree these features would be good to have, I can create a PR. 👍

@freeCodeCamp/moderators Feedback?

@systimotic systimotic added status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. enhancement labels Jan 25, 2017
@raisedadead
Copy link
Member

Yes, please... and lets try and standardize this time, for simplicity

@BerkeleyTrue BerkeleyTrue added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Jan 25, 2017
@systimotic
Copy link
Member Author

systimotic commented Jan 25, 2017

@raisedadead PR is #12829
Can you elaborate on what you mean by "try and standardize?"

Edit: referenced wrong issue...

@QuincyLarson
Copy link
Contributor

@systimotic I agree that this would be really helpful. Ideally, a single keystroke, rather than a sequence (kind of like how our ctrl+enter runs code).

@raisedadead
Copy link
Member

@systimotic apologies for delay in getting back, we would want the keyboard shortcuts in tune with gmail and github and do that sitewide.

More reference:
https://help.github.com/articles/using-keyboard-shortcuts/

And maybe even list this in our wiki.

@systimotic
Copy link
Member Author

@raisedadead No problem!
I wasn't able to spot hotkeys on GitHub that do what these keys should do.

You suggested Ctrl + Shift + E to focus the editor in #8193, so that's what I used. I can change it if it would be better as something else.
I used escape to unfocus the editor, as it's what I try automatically when I want to unfocus something.

I previously wrote a wiki article about our keyboard shortcuts, inspired by #8104.

I just noticed I linked my comment that should've gone to the PR to this issue itself 😅 I should put "Amazing at pasting the wrong links" in my portfolio 😄 The actual PR is #12829

@raisedadead
Copy link
Member

I should be more clear in my views, sorry... 😅 !

So here you go:

  • GitHub uses gi for navigating to issues.
  • Note these are to pressed individually a
  • This works only when the focus is not on any textarea etc.
  • We should standardize to something similar only using fefor editor.
  • We should probably standardize this for our other shortcuts as well, leaving the submission one of course because we don't want to break the existing user experience and "habit".
  • These keys shortcuts should be distinct clearly and documented only in the wiki, etc. for power users.

Why f? Well because g is used by "gmail" and "github".
Wht do you think? Once again, sorry for not being clear earlier. And thanks a lot for the feature!

@raisedadead raisedadead added the scope: UI Threads for addressing UX changes and improvements to user interface label Jan 27, 2017
@systimotic
Copy link
Member Author

@raisedadead No worries!

Note these are to pressed individually
These keys shortcuts should be distinct clearly and documented only in the wiki, etc. for power users.

✔️ 👍 This is what we currently do.

Why f? Well because g is used by "gmail" and "github".

I would agree, but we're already using g for so many shortcuts, I think it would probably be better to stick to that. I was also under the impression that the "g" stood for "go", rather than the name of the product. This especially makes sense as all the hotkeys that don't "go" anywhere do not start with "g".

This works only when the focus is not on any textarea etc.

Yep, which is why all editor hotkeys involve a modifier key. This is a large part of the reason why I want an unfocussing hotkey so bad, otherwise I can't use most of the other hotkeys without going to the mouse first. I think escape is a good choice for an unfocussing hotkey, but I'm open to suggestions for other keys.

To stick to the theme of all editor-related hotkeys being "a single keystroke, rather than a sequence" (quoting Quincy), I like Ctrl + Shift + E to focus the editor. If we want to be more like GitHub, I suggest we do something like e, like they have s to focus the search bar.

@raisedadead
Copy link
Member

I suggest we do something like e, like they have s to focus the search bar.

💯 x 💯 !

@BerkeleyTrue BerkeleyTrue removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Jan 30, 2017
@dhcodes
Copy link
Contributor

dhcodes commented Jan 30, 2017

@raisedadead should I unmerge this then? I didn't realize there were other changes in the works.

@raisedadead
Copy link
Member

@dhcodes we can have separate PRs if everyone agrees.

@systimotic
Copy link
Member Author

I'm sorry, I'm not following what's going on. 😕 What other changes are in the works?

I may have to redo some of the changes as per #12832 (comment)

I previously shared this wiki article in this thread, showing that the hotkeys seem standardized and document as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: UI Threads for addressing UX changes and improvements to user interface status: discussing Under discussion threads. Closed as stale after 60 days of inactivity.
Projects
None yet
Development

No branches or pull requests

5 participants