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

[WIP] Add arrow keys to navigate in step challenges #12832

Conversation

systimotic
Copy link
Member

Pre-Submission Checklist

  • Your pull request targets the staging branch of freeCodeCamp.
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/signin-issue)
  • You have only one commit (if not, squash them into one commit).
  • All new and existing tests pass the command npm test. Use git commit --amend to amend any fixes.

Type of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Add new translation (feature adding new translations)

Checklist:

Description

Found this kind-of-old-but-fun issue. I was doing keyboard shortcut stuff today anyway, so I thought I'd go ahead and implement this.
Pressing the left arrow key goes to the previous slide, right arrow key goes to the next. If the next slide is blocked, you'll have to open the link first.
This is on keyup instead of keydown, so that you don't accidentally skip over a bunch of stuff by holding down the key.

I'm very, very new to React, so feedback would be awesome!

@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
import classnames from 'classnames';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import PureComponent from 'react-pure-render/component';
import LightBox from 'react-images';
import MouseTrap from 'mousetrap';

This comment was marked as off-topic.

@QuincyLarson
Copy link
Contributor

@systimotic what's the status of this PR? Have you had a chance to make the changes @BerkeleyTrue recommended?

@systimotic
Copy link
Member Author

@QuincyLarson I've had a hard time getting to work over the past two weeks. You might be able to tell from the activity on my profile that I didn't get a whole lot of things done 😞
I'm completely new to Redux, so I started reading up on it a bit. I'm still not quite sure how I should do this with Redux. I'm having a hard time finding time to learn more, but I definitely do want to learn more. Any links, tips and other advice would be amazing!

As it stands, it may take a little while before I have enough Redux knowledge to solve this issue the proper way.

@QuincyLarson
Copy link
Contributor

@systimotic I'm inexperienced with Redux myself. I would recommend asking @BerkeleyTrue or @Bouncey for help with this. It's not a super high priority, so take your time :)

@systimotic systimotic changed the title Add arrow keys to navigate in step challenges [WIP] Add arrow keys to navigate in step challenges Feb 27, 2017
@systimotic systimotic force-pushed the feature/step-challenges-keyboard branch 3 times, most recently from aba5f4d to 9685a4d Compare February 28, 2017 13:48
@systimotic systimotic force-pushed the feature/step-challenges-keyboard branch from 9685a4d to 5ac7193 Compare March 5, 2017 00:19
@camperbot
Copy link
Contributor

@systimotic updated the pull request.

* Add arrow keys to navigate in step challenges

* fixed bind and unbind of arrow keys in line with component life cycle

Did a rebase and merge conflict fixing, let's hope I didn't mess things up too bad 😅
@camperbot
Copy link
Contributor

@systimotic updated the pull request.

@BerkeleyTrue
Copy link
Contributor

Looking at this code it is apparent that we should have some defined way to add mouse events to components themselves and leave the mousetrap epic as a place to put global key events.

Let me stew on this...

@BerkeleyTrue
Copy link
Contributor

Hey @systimotic

We are going to need to rethink how we implement mousetrap in the codebase. I think I haven't expressed how mousetrap bindings should be added at the component level. This is unfortunately a low priority as we try to get beta launched.

We are closing as many issues and PR's as possible to clear up the debt we have incurred so I'm closing this.

@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 Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment from manzilo Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment from manzilo Sep 2, 2017
@freeCodeCamp freeCodeCamp deleted a comment from manzilo Sep 2, 2017
@systimotic
Copy link
Member Author

@BerkeleyTrue 👍 I understand. Getting the beta launched is way more important than this.

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.

None yet

5 participants