Display existing prompts in instruct migration dialog

9d3887800789797f31d02a71b2412c092edba066

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +11 -3Showing whitespace changes
public/scripts/sysprompt.js+2 -1
@@ -73,7 +73,8 @@ export async function checkForSystemPromptInInstructTemplate(name, template) {
7373 return;
7474 }
7575 if ('system_prompt' in template && template.system_prompt) {
7676 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 });
7778 const confirm = await callGenericPopup(html, POPUP_TYPE.CONFIRM);
7879 if (confirm) {
7980 const migratedName = `[Migrated] ${name}`;
public/scripts/templates/migrateInstructPrompt.html+9 -2
@@ -1,10 +1,17 @@
11<h3>
22 This instruct template also contains a system prompt.
33</h3>
44<div class="marginBot10">
55 Would you like to migrate the system prompt from the template?
66</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">
815 <div>
916 <small>
1017 <b>"Yes"</b> &ndash; The prompt will be imported and selected as a current system prompt.