-
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
Added Keyboard shortcuts modal #6112
Added Keyboard shortcuts modal #6112
Conversation
@roryabraham Need help with three things.
I feel should modify this to a centred modal. Can you help me understand a better approach here?
Also @shawnborton Can you confirm the colors for the styling and if the |
Can we use a smaller modal style for this? I don't think it needs to take up the full screen. I'm also curious to see what mobile looks like? I think a border radius on the table would look nice. I don't think we need gray backgrounds for the left column cells either, perhaps we can just give those cells a right border. |
It also looks like the table is not using the correct font family. |
@shawnborton I've updated screenshots in GH Body.
@roryabraham Can you please review 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.
@roryabraham we use the waiting for copy label to get copy reviewed which I applied but it did not ping anyone. Do you know if that label does not work in these types of GHs? |
Sorry @rosegrech, I should've remembered that. It didn't work because this is a pull request, not an issue. |
no worries @roryabraham good for me to know that. Amazing catch, I see what you mean. It looks like the shortcuts are all about chat yeah?
|
Resolved conflicts and pushed. @roryabraham Any other changes required for this one? |
@roryabraham PR updated. But I was wondering if, after the new and then the function calls be like ``
|
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.
Overall great progress! I love the work that we've done here to create an extensible framework for keyboard shortcuts in our app, and I think we are now very close to a final version.
I also want to thank you for your patience with me as we've iteratively improved this design in several rounds of reviews. Almost there, let's get this over the finish line!
isVisible={this.state.isOpen} | ||
type={modalType} | ||
containerStyle={styles.keyboardShortcutModalContainer} | ||
onClose={() => this.hideKeyboardShortcutModal()} |
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.
onClose={() => this.hideKeyboardShortcutModal()} | |
onClose={this.hideKeyboardShortcutModal} |
containerStyle={styles.keyboardShortcutModalContainer} | ||
onClose={() => this.hideKeyboardShortcutModal()} | ||
> | ||
<HeaderWithCloseButton title={this.props.translate('keyboardShortcutModal.title')} onCloseButtonPress={() => this.hideKeyboardShortcutModal()} /> |
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.
<HeaderWithCloseButton title={this.props.translate('keyboardShortcutModal.title')} onCloseButtonPress={() => this.hideKeyboardShortcutModal()} /> | |
<HeaderWithCloseButton title={this.props.translate('keyboardShortcutModal.title')} onCloseButtonPress={this.hideKeyboardShortcutModal} /> |
src/libs/KeyboardShortcut/index.js
Outdated
function getKeyboardShortcuts() { | ||
const shortcuts = []; | ||
_.each(keyboardShortcutMap, (descriptionKey, key) => { | ||
shortcuts.push({key, descriptionKey}); |
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.
Just noticing a subtle inconsistency here in that in CONST.js
we define keyboard shortcuts as having the following shape:
{
shortcutKey: String,
descriptionKey: String,
modifiers: Array<String>,
}
But here we're defining them with this a slightly different shape:
{
key: String, // this is really a string with modifiers + the key,
descriptionKey: String
}
So I find this similar but separate representation a bit confusing, and I think we could make this a bit clearer by having keyboardShortcutMap
store a representation of keyboard shortcuts with the following shape:
{
// The key that is pressed to initiate some action
shortcutKey: String,
// Modifier keys that also must be pressed with the shortcut key to initiate this action
modifiers: Array<String>,
// The human-readable representation of the shortcut with its modifiers (i.e: `CMD + SHIFT + K`)
displayName: String,
// A translation key for the full description of the action initiated by this keyboard shortcut
descriptionKey: String,
}
@roryabraham PR updated |
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.
This PR is looking great! Thanks for making all those changes @akshayasalvi! Really happy with how this ended up.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Wow, This PR has whoopping 42 commits. |
@akshayasalvi Just FYI, this PR caused a crash on iOS/Android because we renamed methods on |
Noted @roryabraham. Sorry about that. Thanks for fixing @parasharrajat |
🚀 Deployed to staging by @roryabraham in version: 1.1.16-11 🚀
|
The accessibility issues found in this PR:
Non-interactive.Keyboard.Shortcuts.heading.is.focused.with.Tab.key.mp4
The.question.mark.is.no.announced.as.part.of.keyboard.command.mp4 |
🚀 Deployed to production by @roryabraham in version: 1.1.17-7 🚀
|
* @returns {Array} | ||
*/ | ||
function getKeyboardShortcuts() { | ||
return _.values(keyboardShortcutMap); |
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.
This has introduced a small regression in #18542.
In short, the order of keyboard shortcuts wasn't consistent across browsers, we solved this by using .sort()
Details
Fixed Issues
$ #5588
Tests
QA Steps
Cmd + ?
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android