Backport of [ui] general keyboard navigation: 1.3.4 release into release/1.3.x #14169
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #14138 to be assessed for backporting due to the inclusion of the label backport/1.3.x.
WARNING automatic cherry-pick of commits failed. Commits will require human attention.
The below text is copied from the body of the original PR.
(Port of #12831 for pre-1.4 release)
A general Keyboard / Keynav service for the Nomad UI
g j
to go to jobs index),shift + right-arrow
to move to the next subnav section), andshift + 03
to go to the third link in a given list)?
anyplace in the appImplementation and extension
keyboard
service that emits a consumablebuffer
array andmatchedCommand
objectkeyboard.keyCommands
, that command'saction
is run. These actions can be any function, and are commonlyrouter.transitionTo()
objects.Shift
keyboard-commands
(for example, how we conditionally add the escape key to Evaluations modal)Side-effects
u
shortcut to "Go up a level" from nested routes, reworked many otherwise-inline subnavs into their own components, such as the plugin subnavShowing the keyboard modal (user pressed "?"):
![image](https://user-images.githubusercontent.com/713991/182520304-fa0ec61b-24e4-4f7f-a2a8-cf216fdf69bc.png)
Showing hints active (user holding "Shift"):
![image](https://user-images.githubusercontent.com/713991/182520218-93da5b06-772f-4545-9652-a1206093bf86.png)