From 744fadbded668ce1da2edbc7982c9647a6b6fd79 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 12 Jan 2026 05:48:42 +0000 Subject: [PATCH] feat: loop configure section picker --- src/commands/configure.ts | 44 ++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/commands/configure.ts b/src/commands/configure.ts index 8914300dd..57f8db635 100644 --- a/src/commands/configure.ts +++ b/src/commands/configure.ts @@ -155,41 +155,33 @@ async function promptConfigureSections( runtime: RuntimeEnv, ): Promise { const selected: WizardSection[] = []; - let remaining = CONFIGURE_SECTION_OPTIONS.slice(); - let addMore = true; + const continueValue = "__continue"; - while (addMore && remaining.length > 0) { + while (true) { const choice = guardCancel( - await select({ - message: - selected.length === 0 - ? "Select a section to configure" - : "Select another section to configure", - options: remaining, - initialValue: remaining[0]?.value, + await select({ + message: "Select sections to configure", + options: [ + ...CONFIGURE_SECTION_OPTIONS, + { + value: continueValue, + label: "Continue", + hint: selected.length === 0 ? "Skip for now" : "Run selected", + }, + ], + initialValue: CONFIGURE_SECTION_OPTIONS[0]?.value, }), runtime, - ) as WizardSection; - - if (!selected.includes(choice)) { - selected.push(choice); - } - - remaining = CONFIGURE_SECTION_OPTIONS.filter( - (option) => !selected.includes(option.value), ); - if (remaining.length === 0) { + if (choice === continueValue) { break; } - addMore = guardCancel( - await confirm({ - message: "Configure another section?", - initialValue: false, - }), - runtime, - ); + const section = choice as WizardSection; + if (!selected.includes(section)) { + selected.push(section); + } } return selected;