feat: support ctrl+c dismissal in ask flow

This commit is contained in:
Erik Kotsiuba
2026-04-19 16:32:27 +02:00
parent 0386239f5e
commit fcd1f1bce5
7 changed files with 72 additions and 0 deletions
+24
View File
@@ -79,3 +79,27 @@ test("note editing mode delegates arrows and tab to the editor", () => {
kind: "delegateToEditor",
});
});
test("ctrl+c dismisses the flow from both navigation and editing modes", () => {
const navigation = createInitialState({
questions: [
{
id: "q1",
prompt: "Question?",
options: [{ value: "a", label: "A" }],
},
],
});
const input = inputState();
const note = enterQuestionNoteMode(navigation, "q1");
assert.deepEqual(getInputCommand(navigation, "\u0003"), {
kind: "dismiss",
});
assert.deepEqual(getInputCommand(input, "\u0003"), {
kind: "dismiss",
});
assert.deepEqual(getInputCommand(note, "\u0003"), {
kind: "dismiss",
});
});