refactor(cli): keyboard handling and AskUserDialog (#17414)

This commit is contained in:
Jacob Richman
2026-01-27 14:26:00 -08:00
committed by GitHub
parent 3103697ea7
commit b51323b40c
46 changed files with 1220 additions and 385 deletions
+8
View File
@@ -56,6 +56,8 @@ export enum Command {
NAVIGATION_DOWN = 'nav.down',
DIALOG_NAVIGATION_UP = 'nav.dialog.up',
DIALOG_NAVIGATION_DOWN = 'nav.dialog.down',
DIALOG_NEXT = 'nav.dialog.next',
DIALOG_PREV = 'nav.dialog.previous',
// Suggestions & Completions
ACCEPT_SUGGESTION = 'suggest.accept',
@@ -206,6 +208,8 @@ export const defaultKeyBindings: KeyBindingConfig = {
{ key: 'down', shift: false },
{ key: 'j', shift: false },
],
[Command.DIALOG_NEXT]: [{ key: 'tab', shift: false }],
[Command.DIALOG_PREV]: [{ key: 'tab', shift: true }],
// Suggestions & Completions
[Command.ACCEPT_SUGGESTION]: [{ key: 'tab' }, { key: 'return', ctrl: false }],
@@ -332,6 +336,8 @@ export const commandCategories: readonly CommandCategory[] = [
Command.NAVIGATION_DOWN,
Command.DIALOG_NAVIGATION_UP,
Command.DIALOG_NAVIGATION_DOWN,
Command.DIALOG_NEXT,
Command.DIALOG_PREV,
],
},
{
@@ -426,6 +432,8 @@ export const commandDescriptions: Readonly<Record<Command, string>> = {
[Command.NAVIGATION_DOWN]: 'Move selection down in lists.',
[Command.DIALOG_NAVIGATION_UP]: 'Move up within dialog options.',
[Command.DIALOG_NAVIGATION_DOWN]: 'Move down within dialog options.',
[Command.DIALOG_NEXT]: 'Move to the next item or question in a dialog.',
[Command.DIALOG_PREV]: 'Move to the previous item or question in a dialog.',
// Suggestions & Completions
[Command.ACCEPT_SUGGESTION]: 'Accept the inline suggestion.',