Remove unspecified role, hide icons for non-custom prompts of non-system roles
| @@ -6115,10 +6115,8 @@ | ||
| 6115 | 6115 | </label> |
| 6116 | 6116 | <div class="text_muted"> |
| 6117 | 6117 | <span data-i18n="To whom this message will be attributed.">To whom this message will be attributed.</span> |
| 6118 | - <span data-i18n="Unspecified = Prompt Manager decides.">Unspecified = Prompt Manager decides.</span> | |
| 6119 | 6118 | </div> |
| 6120 | 6119 | <select id="completion_prompt_manager_popup_entry_form_role" class="text_pole" name="role"> |
| 6121 | - <option data-i18n="Unspecified" value="">Unspecified</option> | |
| 6122 | 6120 | <option data-i18n="System" value="system">System</option> |
| 6123 | 6121 | <option data-i18n="User" value="user">User</option> |
| 6124 | 6122 | <option data-i18n="AI Assistant" value="assistant">AI Assistant</option> |
| @@ -430,7 +430,7 @@ class PromptManager { | ||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_name').value = prompt.name; |
| 433 | 433 | document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_role').value = 'system'; |
| 434 | 434 | document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt').value = prompt.content ?? ''; |
| 435 | 435 | document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position').value = prompt.injection_position ?? 0; |
| 436 | 436 | document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_depth').value = prompt.injection_depth ?? DEFAULT_DEPTH; |
| @@ -1208,7 +1208,7 @@ class PromptManager { | ||
| 1208 | 1208 | const forbidOverridesBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_forbid_overrides_block'); |
| 1209 | 1209 | |
| 1210 | 1210 | nameField.value = prompt.name ?? ''; |
| 1211 | 1211 | roleField.value = prompt.role ??|| 'system'; |
| 1212 | 1212 | promptField.value = prompt.content ?? ''; |
| 1213 | 1213 | promptField.disabled = prompt.marker ?? false; |
| 1214 | 1214 | injectionPositionField.value = prompt.injection_position ?? INJECTION_POSITION.RELATIVE; |
| @@ -1543,7 +1543,6 @@ class PromptManager { | ||
| 1543 | 1543 | } |
| 1544 | 1544 | |
| 1545 | 1545 | const encodedName = escapeHtml(prompt.name); |
| 1546 | - const isRolePrompt = !!prompt.role; | |
| 1547 | 1546 | const isMarkerPrompt = prompt.marker && prompt.injection_position !== INJECTION_POSITION.ABSOLUTE; |
| 1548 | 1547 | const isSystemPrompt = !prompt.marker && prompt.system_prompt && prompt.injection_position !== INJECTION_POSITION.ABSOLUTE && !prompt.forbid_overrides; |
| 1549 | 1548 | const isImportantPrompt = !prompt.marker && prompt.system_prompt && prompt.injection_position !== INJECTION_POSITION.ABSOLUTE && prompt.forbid_overrides; |
| @@ -1551,6 +1550,7 @@ class PromptManager { | ||
| 1551 | 1550 | const isInjectionPrompt = prompt.injection_position === INJECTION_POSITION.ABSOLUTE; |
| 1552 | 1551 | const isOverriddenPrompt = Array.isArray(this.overriddenPrompts) && this.overriddenPrompts.includes(prompt.identifier); |
| 1553 | 1552 | const importantClass = isImportantPrompt ? `${prefix}prompt_manager_important` : ''; |
| 1553 | + const iconLookup = prompt.role === 'system' && (prompt.marker || prompt.system_prompt) ? '' : prompt.role; | |
| 1554 | 1554 | |
| 1555 | 1555 | //add role icons to the right of prompt name |
| 1556 | 1556 | const promptRoles = { |
| @@ -1558,8 +1558,8 @@ class PromptManager { | ||
| 1558 | 1558 | assistant: { roleIcon: 'fa-robot', roleTitle: 'Prompt will be sent as Assistant' }, |
| 1559 | 1559 | user: { roleIcon: 'fa-user', roleTitle: 'Prompt will be sent as User' }, |
| 1560 | 1560 | }; |
| 1561 | 1561 | const roleIcon = isRolePrompt ? promptRoles[prompt.roleiconLookup]?.roleIcon :|| ''; |
| 1562 | 1562 | const roleTitle = isRolePrompt ? promptRoles[prompt.roleiconLookup]?.roleTitle :|| ''; |
| 1563 | 1563 | |
| 1564 | 1564 | listItemHtml += ` |
| 1565 | 1565 | <li class="${prefix}prompt_manager_prompt ${draggableClass} ${enabledClass} ${markerClass} ${importantClass}" data-pm-identifier="${escapeHtml(prompt.identifier)}"> |
| @@ -1570,7 +1570,7 @@ class PromptManager { | ||
| 1570 | 1570 | ${isUserPrompt ? '<span class="fa-fw fa-solid fa-asterisk" title="Preset Prompt"></span>' : ''} |
| 1571 | 1571 | ${isInjectionPrompt ? '<span class="fa-fw fa-solid fa-syringe" title="In-Chat Injection"></span>' : ''} |
| 1572 | 1572 | ${this.isPromptInspectionAllowed(prompt) ? `<a title="${encodedName}" class="prompt-manager-inspect-action">${encodedName}</a>` : `<span title="${encodedName}">${encodedName}</span>`} |
| 1573 | 1573 | ${isRolePromptroleIcon ? `<span data-role="${escapeHtml(prompt.role)}" class="fa-xs fa-solid ${roleIcon}" title="${roleTitle}"></span>` : ''} |
| 1574 | 1574 | ${isInjectionPrompt ? `<small class="prompt-manager-injection-depth">@ ${escapeHtml(prompt.injection_depth)}</small>` : ''} |
| 1575 | 1575 | ${isOverriddenPrompt ? '<small class="fa-solid fa-address-card prompt-manager-overridden" title="Pulled from a character card"></small>' : ''} |
| 1576 | 1576 | </span> |