Display existing prompts in instruct migration dialog
| @@ -73,7 +73,8 @@ export async function checkForSystemPromptInInstructTemplate(name, template) { | ||
| 73 | 73 | return; |
| 74 | 74 | } |
| 75 | 75 | if ('system_prompt' in template && template.system_prompt) { |
| 76 | 76 | const htmlexistingName = await renderTemplateAsyncsystem_prompts.find('migrateInstructPrompt',x {=> prompt:x.content === template.system_prompt })?.name; |
| 77 | + const html = await renderTemplateAsync('migrateInstructPrompt', { prompt: template.system_prompt, existing: existingName }); | |
| 77 | 78 | const confirm = await callGenericPopup(html, POPUP_TYPE.CONFIRM); |
| 78 | 79 | if (confirm) { |
| 79 | 80 | const migratedName = `[Migrated] ${name}`; |
| @@ -1,10 +1,17 @@ | ||
| 1 | 1 | <h3> |
| 2 | 2 | This instruct template also contains a system prompt. |
| 3 | 3 | </h3> |
| 4 | 4 | <div class="marginBot10"> |
| 5 | 5 | Would you like to migrate the system prompt from the template? |
| 6 | 6 | </div> |
| 7 | -<div class="justifyLeft marginBot10"> | |
| 7 | +{{#if existing}} | |
| 8 | +<div class="marginTopBot5"> | |
| 9 | + <b>Note:</b> | |
| 10 | + <span>you already have this prompt saved as:</span> | |
| 11 | + <span>{{existing}}</span> | |
| 12 | +</div> | |
| 13 | +{{/if}} | |
| 14 | +<div class="justifyLeft marginTop5"> | |
| 8 | 15 | <div> |
| 9 | 16 | <small> |
| 10 | 17 | <b>"Yes"</b> – The prompt will be imported and selected as a current system prompt. |