From 771a729eb7cb70a97b07df776f78904f84a3565f Mon Sep 17 00:00:00 2001 From: Tibsfox Date: Mon, 6 Apr 2026 19:25:52 -0700 Subject: [PATCH] fix(tui): prevent Enter key infinite loop in interview notes mode When "None of the above" was selected and the notes field was already visible but empty, pressing Enter re-opened the notes field endlessly because the guard only checked !notes (empty string is falsy). Add !notesVisible guard so auto-open only triggers on the initial selection, not when the user is confirming from an already-open notes field. Closes #3450 Closes #3449 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/resources/extensions/shared/interview-ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/extensions/shared/interview-ui.ts b/src/resources/extensions/shared/interview-ui.ts index f07112597..c38833761 100644 --- a/src/resources/extensions/shared/interview-ui.ts +++ b/src/resources/extensions/shared/interview-ui.ts @@ -300,7 +300,7 @@ export async function showInterviewRound( // instead of being trapped in a re-asking loop (bug #2715). // Only auto-open if the user hasn't already provided notes — // otherwise Enter from notes mode loops back here endlessly. - if (!isMultiSelect(currentIdx) && states[currentIdx].cursorIndex === noneOrDoneIdx(currentIdx) && !states[currentIdx].notes) { + if (!isMultiSelect(currentIdx) && states[currentIdx].cursorIndex === noneOrDoneIdx(currentIdx) && !states[currentIdx].notes && !states[currentIdx].notesVisible) { states[currentIdx].notesVisible = true; focusNotes = true; loadStateToEditor();