Skip to content

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

Closed

Description

@RandellDawson

Problem: When tested on Chrome and Firefox (on Windows) and using the p or n hotkeys, we are supposed to be able to navigate to the next and previous lessons without the editor going back into focus while in the escaped mode. However, on the beta site, I have to keep escaping the editor every single time I click the p or n once I first escape the editor. The original navigation buttons that were removed in favor of the hot keys did not do this.

Activity

  1. raisedadead commented on Oct 9, 2019

    @raisedadead
    Member

    Thanks. Please share the detailed config for your OS.

  2. added
    help wanted
    on Oct 9, 2019
  3. RandellDawson commented on Oct 9, 2019

    @RandellDawson
    MemberAuthor

    Windows 10 Home edition. Using Chrome Version 77.0.3865.90 (Official Build) (64-bit) and Firefox 69.0.2 (64-bit).

  4. added
    status: waiting triage
    on Oct 9, 2019
  5. thecodingaviator commented on Oct 9, 2019

    @thecodingaviator
    Contributor

    I have been able to reproduce this. What is happening is every time n or p is pressed, the new challenge is opened and then the focus of the cursor moves to the editor which makes further navigation impossible unless someone uses their mouse to refocus somewhere else

  6. raisedadead commented on Oct 9, 2019

    @raisedadead
    Member

    Thanks, we know this is confirmed. Lets keep the thread for solutions.

  7. vkWeb commented on Oct 9, 2019

    @vkWeb
    Member

    @ojeytonwilliams Any thoughts on this?

  8. ojeytonwilliams commented on Oct 9, 2019

    @ojeytonwilliams
    Contributor

    @vkWeb I've not been able to reproduce this yet. It works as intended (for me) on Chrome and Firefox on both Windows and Ubuntu, so if anyone could walk me through the steps, that would be a big help.

    @rickysyamsi the original intention was that the editor is focused by default, since that creates the cleanest flow. I.e. if the user wants to immediately get started using the editor, they can. Pressing escape should allow them to navigate freely until they re-focus on the editor restoring the previous behaviour.

  9. raisedadead commented on Oct 9, 2019

    @raisedadead
    Member

    The idea is to not need to touch your mouse more than its needed.

    So when you complete the challenge, your next one is served with the editor already in focus.

    The hotkeys for nav are really a nice to have and by no means our primary way of navigating.

    To quit the focus on the editor and enter a nav mode, you hit escape and start pressing the hot key p or n.

    The editor does not resume focus unless you click on it.

    Once it is in focus, the nav is ended and you have to hit esc again to enter nav.

    I also just realize that I can not scroll challenge description part with keyboard navigation (up and down keys). Should I create a new issue for this?

    Yes please.

  10. raisedadead commented on Oct 9, 2019

    @raisedadead
    Member

    As of this comment the issue is that on Windows at least as reported by OP, the editor automatically gets focused (our intended parent behaviour in non-navigation mode). I for one could not reproduce on macOS or Windows myself.

    This is an annoying experience, nonetheless only for users using the nav mode, which we have not yet advertised.

    So the fix would be to check and handle the use cases as mentioned in my last comment.

  11. ojeytonwilliams commented on Oct 9, 2019

    @ojeytonwilliams
    Contributor

    Currently when using keyboard navigation, students need to press multiple tabs to access editor. I think that it will be very helpful if students can access editor easily with single keyboard press (for example 'e' key).

    @rickysyamsi That's a nice idea! Please could you add that to the up down arrow issue, so we can discuss adding that as a feature.

    After chatting with @thecodingaviator I think I've pinned down how to reproduce the issue.

    1. Open any challenge
    2. Click on the instructions
    3. Press escape
    4. Press n

    The new challenge will open and the editor will get focused.

    Pressing escape only works if the editor is already focused, but clearly that's not how people are using it in practice. I think we should enter navigation mode whenever the Hotkeys have focus.

    @rickysyamsi You're welcome to try and fix this, but don't feel obliged - I can take care of it tomorrow.

  12. raisedadead commented on Oct 9, 2019

    @raisedadead
    Member

    I would recommend @ojeytonwilliams to take a dig at this, probably would be way faster for you to resolve.

    @rickysyamsi you can go ahead and create a pull request for the arrow nav.

    Thanks you all.

  13. RandellDawson commented on Oct 9, 2019

    @RandellDawson
    MemberAuthor

    @ojeytonwilliams My steps to reproduce the problem are similar to yours, but I don't have to do your step 3. I simply:

    1. Open any challenge.
    2. Click on the instructions.
    3. Press n or p.
  14. thecodingaviator commented on Oct 10, 2019

    @thecodingaviator
    Contributor

    @RandellDawson both ways work since both are doing the exact same job i.e. taking the focus off the editor

  15. ojeytonwilliams commented on Oct 10, 2019

    @ojeytonwilliams
    Contributor

    The idea is that unless you actively escape, you aren't in navigation mode and it should behave normally. So, if you're in the flow "Open challenge, read instructions, start typing, ctrl + enter, ctrl + enter, repeat" you never need to touch the mouse as the editor always takes focus when you enter a challenge.

    If you press escape (currently only when in the editor. After #37167 everywhere except the header and the preview) then the editor will not get focused automatically i.e. you're in navigation mode.

    The reason for making people press escape is to prevent them accidentally switching to navigation mode just by clicking on, say, the instructions and being annoyed that they have to keep selecting the editor. Not something they have to do at the moment.

  16. removed
    status: waiting triage
    on Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions