-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ui] Show re-bound keyboard nav hints instead of their default values #20235
[ui] Show re-bound keyboard nav hints instead of their default values #20235
Conversation
Ember Test Audit comparison
|
@@ -110,6 +111,7 @@ export default class KeyboardService extends Service { | |||
{ | |||
label: 'Go to Variables', | |||
action: () => this.router.transitionTo('variables'), | |||
rebindable: true, |
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.
Side-effect: the "go to variables" key command wasn't re-bindable! I must've forgotten during Vars work.
5d1dfb6
to
a0cf98f
Compare
a0cf98f
to
76a7229
Compare
ui/app/services/keyboard.js
Outdated
@@ -209,6 +212,12 @@ export default class KeyboardService extends Service { | |||
}); | |||
} | |||
|
|||
getCommandByPattern(pattern) { |
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.
I don't see where is this one used
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.
Good catch, this is an orphaned method from my first attempt at solving this. Thank you for spotting it!
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 a question, but it looks fine
…#20235) * Rebinds show up as soon as you start rebinding * Hint bind and rebind tests * Orphaned getCommandByPattern method removed
In the Nomad UI, you can re-bind your keyboard shortcuts (from
g j
tojob
to go to the jobs route, for example).But prior to this PR, whether or not you'd re-bound a key command, the hint that would show up when holding
shift
would always be the default. This is because the hints are generated via{{keyboard-shortcut}}
modifier, and are separate from the list of the keyboard service'sdefaultCommands
list.This PR does a lookup on
get hints()
, which fires every time the user holdsshift
.