feat: add submit screen number hotkeys
This commit is contained in:
@@ -188,10 +188,20 @@ export function confirmCurrentSelection(state: AskState): AskState {
|
||||
}
|
||||
|
||||
export function applyNumberShortcut(state: AskState, digit: number): AskState {
|
||||
if (digit <= 0 || isSubmitTab(state)) {
|
||||
if (digit <= 0) {
|
||||
return state;
|
||||
}
|
||||
|
||||
if (isSubmitTab(state)) {
|
||||
if (digit > SUBMIT_ACTION_COUNT) {
|
||||
return state;
|
||||
}
|
||||
return confirmCurrentSelection({
|
||||
...state,
|
||||
activeSubmitActionIndex: digit - 1,
|
||||
});
|
||||
}
|
||||
|
||||
const question = getCurrentQuestion(state);
|
||||
if (!question) {
|
||||
return state;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ export const UI_TEXT = {
|
||||
unanswered: "→ unanswered",
|
||||
footerInput: " Enter submit · Esc close",
|
||||
footerNote: " Enter save · Esc close",
|
||||
footerSubmit: " ↑↓ select · Enter confirm · Esc cancel",
|
||||
footerSubmit: " 1..3 hotkeys · ↑↓ select · Enter confirm · Esc cancel",
|
||||
footerMulti:
|
||||
" ⇆ tab · ↑↓ select · Space toggle · Enter continue · N/Shift+N note · Esc dismiss",
|
||||
footerDefault:
|
||||
|
||||
Reference in New Issue
Block a user