Skip to content

feat: Escape hotkey enters 'navigation mode' - #37167

Merged
raisedadead merged 2 commits into
freeCodeCamp:masterfrom
ojeytonwilliams:fix/reach-navigation-mode-from-instructions
Oct 14, 2019
Merged

raisedadead merged 2 commits into
freeCodeCamp:masterfrom
ojeytonwilliams:fix/reach-navigation-mode-from-instructions

Conversation

@ojeytonwilliams

@ojeytonwilliams ojeytonwilliams commented Oct 10, 2019 •

Copy link
Copy Markdown
Contributor
  • I have read freeCodeCamp's contribution guidelines.
  • My pull request has a descriptive title (not a vague title like Update index.md)
  • My pull request targets the master branch of freeCodeCamp.
  • None of my changes are plagiarized from another source without proper attribution.
  • All the files I changed are in the same world language (for example: only English changes, or only Chinese changes, etc.)
  • My changes do not use shortened URLs or affiliate links.

Previously only 'escape'ing from the editor prevented auto focus on the editor, now you can 'escape' from anywhere that listens to Hotkeys. Now, n and p can only be used to navigate after pressing escape, to prevent accidental navigation.

Also the outline for HotKeys is hidden as it is not used by tab navigation.

Closes #37146

Previously only 'escape'ing from the editor prevented auto focus on the
editor, now you can 'escape' from anywhere that listens to Hotkeys.

Also the outline for HotKeys is hidden as it is not used by tab
navigation.
@ojeytonwilliams
ojeytonwilliams requested a review from a team October 10, 2019 10:54
@gitpod-io

gitpod-io Bot commented Oct 10, 2019 •

Copy link
Copy Markdown

@ojeytonwilliams

Copy link
Copy Markdown
Contributor Author

@RandellDawson @thecodingaviator would you mind taking a look at this and let me know if it behaves how you expect?

@thecodingaviator

Copy link
Copy Markdown
Contributor

I don't really think this is actually fixing the issue at hand at all. To reproduce the problem, just wait till the editor has loaded fully, after that, you'll encounter the same issue as we've discussed.

@thecodingaviator thecodingaviator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above

@ojeytonwilliams

Copy link
Copy Markdown
Contributor Author

@thecodingaviator I had a chat with @RandellDawson and thought that it would be more intuitive if the navigation is disabled until you press escape, regardless of what's currently in focus. So, the new behaviour would be:

Normal behaviour:

  1. Press n or p
  2. It doesn't navigate

To trigger navigation mode:

  1. Press escape
  2. Press n or p
  3. It navigates to the next or previous challenge
  4. Click on the editor
  5. You're back in normal mode.

The idea being accidentally navigating is frustrating, particularly if you can't immediately navigate back. Does that seem reasonable?

@thecodingaviator

Copy link
Copy Markdown
Contributor

@ojeytonwilliams That sounds good to me

@ojeytonwilliams ojeytonwilliams changed the title fix: escape to navigation mode more generally feat: Escape hotkey enters 'navigation mode' Oct 11, 2019
@thecodingaviator

Copy link
Copy Markdown
Contributor

I like the new way we're doing things but I think it'll be good if clicking on the instructions panel also enters nav mode. What do you think @RandellDawson ?

@ojeytonwilliams

ojeytonwilliams commented Oct 11, 2019 •

Copy link
Copy Markdown
Contributor Author

I think it's better if we make navigation mode something you have to purposefully activate. If clicking on the instructions triggered it, that could easily happen by accident.

@RandellDawson

Copy link
Copy Markdown
Member

I like the new way we're doing things but I think it'll be good if clicking on the instructions panel also enters nav mode. What do you think @RandellDawson ?

The problem I saw with clicking on the instructions activating navigation mode, is if you were working on a challenge in the editor and wanted to copy/paste something from the instructions or just accidentally clicked on the instructions (for whatever reason), then all the sudden you are in navigation mode and would not expect it. You could inadvertently end up navigating away from the challenge you were working on. @ojeytonwilliams and I discussed it for a while yesterday and concluded that navigation mode should be a very deliberate action taken by the user.

@thecodingaviator

Copy link
Copy Markdown
Contributor

That sounds reasonable

@RandellDawson

Copy link
Copy Markdown
Member

@freeCodeCamp/dev-team Just need someone from the dev team to review now.

@raisedadead
raisedadead merged commit e256dbc into freeCodeCamp:master Oct 14, 2019
@ojeytonwilliams
ojeytonwilliams deleted the fix/reach-navigation-mode-from-instructions branch October 14, 2019 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Beta] Each time the n or p Hotkey is used, the editor refocuses on Windows

4 participants