-
Notifications
You must be signed in to change notification settings - Fork 484
Initial implementation of quick-switcher (keyboard-driven navigation) #434
Initial implementation of quick-switcher (keyboard-driven navigation) #434
Conversation
867259b
to
3d5c947
Compare
Looks like the frontend build is failing. Going to review the build logs and address any issues. |
b90f245
to
24d70ce
Compare
Fixed the lint errors, minus one:
I need help with focusing the input once the Modal pops up. I am not sure how to do that in an Angular-native manner. Link to code in PR: https://github.com/vmware-tanzu/octant/pull/434/files#diff-cdf196737b682f9089d6e6506bfcebb2R88-R92 |
Oh, it just wants you to use |
Aaaah okay! I am still wondering if there is a better way to focus on the input. Ideally, I should be able to get an event or something that indicates the modal has opened. I couldn’t find how to do that though. |
I like where this going. Is O for object Some other things to think about:
|
I don't have strong opinions on I like the alternatives you propose @bryanl. Here is another one:
I love the idea of using The way I envision this:
re: feature discovery - I am not sure. I just reviewed Slack, Gmail and GitHub and none seem to have anything in the UI for discovering keyboard shortcuts. One thing they do have in common is that they all use |
Hey all, anything I can do to move this forward? |
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
24d70ce
to
5a62941
Compare
|
||
// TODO(abrand): Hack for focusing on input. Need to figure this out. | ||
const el = this.el; | ||
setTimeout(function() { |
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.
TSLint wants this to be setTimout(() => {
EDIT: Also looking into passing an event here
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 think it would be great to use some kind of event instead of relying on setTimeout. I just couldn't figure it out. Would love some help here.
@alexbrand Also can you add |
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
All set @GuessWhoSamFoo 👍 |
Two small changes then lgtm
|
Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
ceef98f
to
ec60eda
Compare
Thanks again @alexbrand ! |
Initial implementation of a quick-switcher / keyboard-driven navigation.
I created a new component that is attached to the root of the application. The component leverages the Clarity modal functionality.
To open the quick-switcher, hit the
k
key. Once open, you can use the input field to filter the list of potential destinations. You can use the arrow keys to go up and down in the list. Once you are set on a destination, hitEnter
to navigate there. You may also use the mouse to select an item from the list.Demo:
Fixes #413