From 31306516830345248b065317220046b23435de84 Mon Sep 17 00:00:00 2001 From: Tim deBoer Date: Thu, 18 Jan 2024 11:02:18 -0500 Subject: [PATCH] feat: improve quick pick formating Improves the quick pick items, adding detail for each. I didn't use the description attribute b/c the layout is slightly off (another PF removal impact?) and to me it is easier to read like this. Fixes #49. Signed-off-by: Tim deBoer --- src/extension.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 16abebb0..c3079220 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -73,15 +73,24 @@ export async function activate(extensionContext: ExtensionContext): Promise { const telemetryData: Record = {}; - - const selectedType = await extensionApi.window.showQuickPick(['qcow2', 'ami', 'raw', 'iso'], { - placeHolder: 'Select image type', - }); - if (!selectedType) { + + const selection = await extensionApi.window.showQuickPick( + [ + { label: 'QCOW2', detail: 'QEMU image (.qcow2)', format: 'qemu' }, + { label: 'AMI', detail: 'Amazon Machine Image (.ami)', format: 'ami' }, + { label: 'RAW', detail: 'Raw image (.raw) with an MBR or GPT partition table', format: 'raw' }, + { label: 'ISO', detail: 'ISO standard disk image (.iso) for flashing media and using EFI', format: 'iso' }, + ], + { + title: 'Select the type of disk image to create', + }, + ); + if (!selection) { telemetryData.canceled = true; telemetryLogger.logUsage('buildDiskImage', telemetryData); return; } + const selectedType = selection.format; telemetryData.imageType = selectedType; const selectedFolder = await extensionApi.window.showInputBox({