-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] Simplify and upgrade KeyboardShortcut library #8059
Conversation
Tagging in @rushatgabhane for a review since you already reviewed most of these changes in #7702 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tagging me
@roryabraham could you please pull the changes to Button.js from #7702?
I'm guessing it'll be needed by #7920 (comment) and #7623
Otherwise, looks good. Liking the change to abstract away the modifiers
Updated to include changes in |
src/components/Button.js
Outdated
/** The priority to assign the enter key event listener. 0 is the highest priority. */ | ||
enterKeyEventListenerPriority: PropTypes.number, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roryabraham extra line breaker. (We really need a eslint rule for this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there somewhere where we've explicitly added this to the review guidelines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we can easily turn on https://eslint.org/docs/rules/no-multiple-empty-lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there somewhere where we've explicitly added this to the review guidelines
Nope.
Yeah, let's add that rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roryabraham I'm gonna create a quick PR for eslint-config-expensify to turn it on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thienlnam LGTM! 🎉 and tests well. All yours!
Commenting since I can't edit the PR PR Reviewer Checklist
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No complaints on the changes, it all looks good - just had one question
META: 'Cmd', | ||
CONTROL: 'CTRL', | ||
ESCAPE: 'ESC', | ||
META: 'CMD', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small question: How come this is called the META key instead of COMMAND?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @thienlnam in version: 1.1.42-0 🚀
|
Oh sorry I was on staging not dev when this happened |
Interesting. Screen.Recording.2022-03-15.at.3.01.59.AM.mov |
One differentiating factor: Key presses are an So a quick fix would be to return early if the event isn't an instance of |
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
Details
This PR branches off of #7702 to extract the group of changes that are related to the KeyboardShortcut library.
It also goes a bit further to simplify and clarify the KeyboardShortcut library API.
Fixed Issues
$ (partial) #7648
Tests (web/desktop)
CMD+I
to open the keyboard shortcut modal.Esc
to close it.CMD+K
to open the search page.Esc
to close it.CMD+SHIFT+K
to open the New Group page.Esc
to close it.Esc
to close it.CMD+C
.Tests (native)
The KeyboardShortcut library is a noop on native. Regression tests only.
PR Review Checklist
Contributor (PR Author) Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)Styling.md
) for all style edits I madeSTYLE.md
)Avatar
, I verified the components usingAvatar
are working as expected)main
branch)PR Reviewer Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)main
branch)QA Steps
Regression tests only.
Screenshots
Web
KeyboardShortcutsWeb.mov
Desktop
KeyboardShortcutDesktop.mov