From db5512ca76d238ad58bd5861827d0598c59908df Mon Sep 17 00:00:00 2001 From: Sukumarsawant Date: Fri, 12 Jun 2026 03:28:03 +0530 Subject: [PATCH 1/2] nit: removed the redundant done and save and added a shortcut --- source/wizards/steps/provider-step.tsx | 34 +++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/source/wizards/steps/provider-step.tsx b/source/wizards/steps/provider-step.tsx index ae612011..61787942 100644 --- a/source/wizards/steps/provider-step.tsx +++ b/source/wizards/steps/provider-step.tsx @@ -155,13 +155,11 @@ export function ProviderStep({ {label: 'Add custom provider manually', value: 'custom'}, ]; - const getTemplateOptions = (): TemplateOption[] => [ - ...PROVIDER_TEMPLATES.map(template => ({ + const getTemplateOptions = (): TemplateOption[] => + PROVIDER_TEMPLATES.map(template => ({ label: template.name, value: template.id, - })), - ...(providers.length > 0 ? [{label: 'Done & Save', value: 'done'}] : []), - ]; + })); const editOptions: TemplateOption[] = providers.map((provider, index) => ({ label: provider.name, @@ -190,11 +188,6 @@ export function ProviderStep({ }; const handleTemplateSelect = (item: TemplateOption) => { - if (item.value === 'done') { - onComplete(providers); - return; - } - // Adding new provider const template = PROVIDER_TEMPLATES.find(t => t.id === item.value); if (template) { @@ -509,7 +502,19 @@ export function ProviderStep({ setMode('field-input'); }; - useInput((_input, key) => { + useInput((input, key) => { + // "Done & Save" shortcut + if ( + mode === 'template-selection' && + providers.length > 0 && + input.toLowerCase() === 'd' && + !key.ctrl && + !key.meta + ) { + onComplete(providers); + return; + } + // Handle Shift+Tab for going back if (key.shift && key.tab) { if (mode === 'field-input') { @@ -611,6 +616,13 @@ export function ProviderStep({ items={getTemplateOptions()} onSelect={(item: TemplateOption) => handleTemplateSelect(item)} /> + {providers.length > 0 && ( + + + Done is always available: press d + + + )} ); } From 65607dc39c7cb0331ff35991fa87359c6b70bc78 Mon Sep 17 00:00:00 2001 From: Sukumarsawant Date: Fri, 12 Jun 2026 03:41:37 +0530 Subject: [PATCH 2/2] nits --- source/wizards/steps/provider-step.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/wizards/steps/provider-step.tsx b/source/wizards/steps/provider-step.tsx index 61787942..9fb24f49 100644 --- a/source/wizards/steps/provider-step.tsx +++ b/source/wizards/steps/provider-step.tsx @@ -41,6 +41,8 @@ interface TemplateOption { value: string; } +const DONE_SHORTCUT_KEY = 'd'; + /** * Find the best matching template for an existing provider config. * Match by id, name, or baseUrl — then fall back to custom. @@ -507,7 +509,9 @@ export function ProviderStep({ if ( mode === 'template-selection' && providers.length > 0 && - input.toLowerCase() === 'd' && + typeof input === 'string' && + input.length > 0 && + input.toLowerCase() === DONE_SHORTCUT_KEY && !key.ctrl && !key.meta ) { @@ -619,7 +623,7 @@ export function ProviderStep({ {providers.length > 0 && ( - Done is always available: press d + Done is always available: press {DONE_SHORTCUT_KEY} )}