fix: preserve multi-select choices with custom answers

This commit is contained in:
Erik Kotsiuba
2026-04-19 16:32:27 +02:00
parent 4a131f7752
commit 8d8e7b67c9
8 changed files with 157 additions and 14 deletions
+6 -2
View File
@@ -64,14 +64,14 @@ function renderSubmittedAnswer(
theme: Theme,
width: number
) {
const answerText = answer.customText ?? answer.labels.join(", ");
const answerText = answer.labels.join(", ");
if (answerText) {
pushWrappedText(
lines,
`→ ${answerText}`,
width,
theme,
answer.customText ? "text" : "success",
isCustomOnlyAnswer(answer) ? "text" : "success",
" ",
" "
);
@@ -106,6 +106,10 @@ function renderSubmittedAnswer(
}
}
function isCustomOnlyAnswer(answer: AskResult["answers"][string]): boolean {
return answer.indices.length === 0 && !!answer.customText;
}
function renderSubmitActions(
lines: string[],
state: AskState,