Skip to content

Commit c1969c4

Browse files
committed
feat(ui): add Ctrl+N/P navigation in command palette
1 parent 75bce20 commit c1969c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/components/CommandPalette.client.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function handleGlobalKeydown(event: KeyboardEvent) {
173173
174174
if (!isOpen.value) return
175175
176-
if (event.key === 'ArrowDown') {
176+
if (event.key === 'ArrowDown' || (event.ctrlKey && event.key.toLowerCase() === 'n')) {
177177
event.preventDefault()
178178
const currentIndex = getCommandElements().findIndex(el => el === document.activeElement)
179179
const nextIndex =
@@ -182,7 +182,7 @@ function handleGlobalKeydown(event: KeyboardEvent) {
182182
return
183183
}
184184
185-
if (event.key === 'ArrowUp') {
185+
if (event.key === 'ArrowUp' || (event.ctrlKey && event.key.toLowerCase() === 'p')) {
186186
event.preventDefault()
187187
const currentIndex = getCommandElements().findIndex(el => el === document.activeElement)
188188
if (currentIndex <= 0) {

i18n/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"quick_actions": "jump to...",
8686
"subtitle": "navigate across npmx and switch settings quickly",
8787
"subtitle_languages": "choose a language or help improve translations",
88-
"instructions": "Type to filter commands. Use the arrow keys to move through results and Enter to run a command.",
88+
"instructions": "Type to filter commands. Use the arrow keys or Ctrl+N/P to move through results and Enter to run a command.",
8989
"input_label": "Command palette search",
9090
"results_label": "Command results",
9191
"placeholder": "type a command...",

0 commit comments

Comments
 (0)