From 8dcd9a055cefcca1f67141d8c0dc8bbb2bec01e0 Mon Sep 17 00:00:00 2001 From: tsushanth <78000697+tsushanth@users.noreply.github.com> Date: Sun, 14 Jun 2026 02:50:27 -0700 Subject: [PATCH] fix(installing.commands): show only names in checkbox summary (#12393) Closes pnpm/pnpm#12386 --- .changeset/fix-interactive-prompt-summary.md | 7 +++++++ deps/compliance/commands/src/audit/audit.ts | 7 ++++++- installing/commands/src/update/index.ts | 7 ++++++- installing/commands/test/update/interactive.ts | 6 ++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .changeset/fix-interactive-prompt-summary.md diff --git a/.changeset/fix-interactive-prompt-summary.md b/.changeset/fix-interactive-prompt-summary.md new file mode 100644 index 0000000000..c0760084af --- /dev/null +++ b/.changeset/fix-interactive-prompt-summary.md @@ -0,0 +1,7 @@ +--- +"@pnpm/installing.commands": patch +"@pnpm/deps.compliance.commands": patch +"pnpm": patch +--- + +Fix garbled summary line after submitting `pnpm update -i` and `pnpm audit --fix -i`. The interactive checkbox prompt previously printed every selected choice's full table row (label, current/target versions, workspace, URL) joined by commas, producing a wall of text after pressing Enter. The summary now lists only the selected package names (or vulnerability keys) by setting an explicit `short` per choice; the in-progress selection UI is unchanged. diff --git a/deps/compliance/commands/src/audit/audit.ts b/deps/compliance/commands/src/audit/audit.ts index fb8ab5b356..031d559cb8 100644 --- a/deps/compliance/commands/src/audit/audit.ts +++ b/deps/compliance/commands/src/audit/audit.ts @@ -468,7 +468,7 @@ async function interactiveAuditFix (auditReport: AuditReport): Promise = [] + const flatChoices: Array = [] for (const group of choiceGroups) { flatChoices.push(new Separator(chalk.bold(`── ${group.message} ──`))) for (const choice of group.choices) { @@ -478,6 +478,11 @@ async function interactiveAuditFix (auditReport: AuditReport): Promise = [] + const flatChoices: Array = [] for (const group of choiceGroups) { flatChoices.push(new Separator(chalk.bold(`── ${group.message} ──`))) for (const choice of group.choices) { @@ -238,6 +238,11 @@ async function interactiveUpdate ( flatChoices.push({ name: choice.message, value: choice.value, + // `name` is the rendered table row (label + versions + workspace + url) + // that lays out a single choice during selection. After submission + // @inquirer/prompts comma-joins each choice's `short`, which without + // this defaults to `name` and dumps the whole table back to stdout. + short: choice.value, }) } } diff --git a/installing/commands/test/update/interactive.ts b/installing/commands/test/update/interactive.ts index 6c864605db..6033af3187 100644 --- a/installing/commands/test/update/interactive.ts +++ b/installing/commands/test/update/interactive.ts @@ -116,10 +116,12 @@ test('interactively update', async () => { { name: `is-negative 1.0.0 ❯ 1.0.${chalk.greenBright.bold('1')} `, value: 'is-negative', + short: 'is-negative', }, { name: `micromatch 3.0.0 ❯ 3.${chalk.yellowBright.bold('1.10')} `, value: 'micromatch', + short: 'micromatch', }, ]) expect(mockCheckbox).toHaveBeenCalledWith( @@ -165,14 +167,17 @@ test('interactively update', async () => { { name: `is-negative 1.0.1 ❯ ${chalk.redBright.bold('2.1.0')} `, value: 'is-negative', + short: 'is-negative', }, { name: `is-positive 2.0.0 ❯ ${chalk.redBright.bold('3.1.0')} `, value: 'is-positive', + short: 'is-positive', }, { name: `micromatch 3.0.0 ❯ ${chalk.redBright.bold('4.0.0')} `, value: 'micromatch', + short: 'micromatch', }, ]) expect(mockCheckbox).toHaveBeenCalledWith( @@ -311,6 +316,7 @@ test('interactively update should ignore dependencies from the ignoreDependencie { name: `micromatch 3.0.0 ❯ 3.${chalk.yellowBright.bold('1.10')} `, value: 'micromatch', + short: 'micromatch', }, ] )