Add keyboard shortcuts for repository file and code search (#36416)
Resolves #36417: Add GitHub-like keyboard shortcuts for repository navigation: - Press `T` to focus the "Go to file" search input - Press `S` to focus the "Search code" input - Press `Escape` to clear and unfocus search inputs --------- Signed-off-by: Micah Kepe <micahkepe@gmail.com> Signed-off-by: silverwind <me@silverwind.io> Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{{template "devtest/devtest-header"}}
|
||||
<div class="page-content devtest ui container">
|
||||
<h1>Keyboard Shortcut</h1>
|
||||
|
||||
<div>
|
||||
<div class="ui input global-shortcut-wrapper">
|
||||
<input class="ui input" placeholder="Press S to focus">
|
||||
<kbd data-global-init="onGlobalShortcut" data-shortcut-keys="s">S</kbd>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tw-mt-2">
|
||||
<div class="ui action input">
|
||||
<div class="ui input global-shortcut-wrapper">
|
||||
<input class="ui input" placeholder="Press T to focus">
|
||||
<kbd data-global-init="onGlobalShortcut" data-shortcut-keys="t">T</kbd>
|
||||
</div>
|
||||
<button class="ui button">Go</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "devtest/devtest-footer"}}
|
||||
Reference in New Issue
Block a user