| 1550 | 1550 | const isInjectionPrompt = prompt.injection_position === INJECTION_POSITION.ABSOLUTE; |
| 1551 | 1551 | const isOverriddenPrompt = Array.isArray(this.overriddenPrompts) && this.overriddenPrompts.includes(prompt.identifier); |
| 1552 | 1552 | const importantClass = isImportantPrompt ? `${prefix}prompt_manager_important` : ''; |
| 1553 | + |
| 1554 | + //add role icons to the right of prompt name |
| 1555 | + |
| 1556 | + const hasRole = prompt.role ? true : false; |
| 1557 | + let roleIcon, roleTitle; |
| 1558 | + if (hasRole) { |
| 1559 | + switch (prompt.role) { |
| 1560 | + case 'system': |
| 1561 | + roleIcon = 'fa-cog'; |
| 1562 | + roleTitle = 'Prompt will be sent as System'; |
| 1563 | + break; |
| 1564 | + case 'assistant': |
| 1565 | + roleIcon = 'fa-robot'; |
| 1566 | + roleTitle = 'Prompt will be sent as Assistant'; |
| 1567 | + break; |
| 1568 | + case 'user': |
| 1569 | + roleIcon = 'fa-user'; |
| 1570 | + roleTitle = 'Prompt will be sent as User'; |
| 1571 | + } |
| 1572 | + |
| 1573 | + // not sure if this makes sense to include as 'markers' should not be sendable except by System, included in case I'm wrong. |
| 1574 | + // if it shouldn't be changeable, we should remove that dropdown from editor for Marker prompts. |
| 1575 | + /* |
| 1576 | + if (isMarkerPrompt && prompt.role !== 'user' && prompt.role !== 'assistant' && prompt.role !== 'system') { |
| 1577 | + roleIcon = 'fa-cog'; |
| 1578 | + roleTitle = 'ST Global Prompt is sent as System by default (but can be changed in Editor)'; |
| 1579 | + } |
| 1580 | + */ |
| 1581 | + } |
| 1582 | + |
| 1553 | 1583 | listItemHtml += ` |
| 1554 | 1584 | <li class="${prefix}prompt_manager_prompt ${draggableClass} ${enabledClass} ${markerClass} ${importantClass}" data-pm-identifier="${prompt.identifier}"> |
| 1555 | 1585 | <span class="${prefix}prompt_manager_prompt_name" data-pm-name="${encodedName}"> |
| 1556 | 1586 | ${isMarkerPrompt ? '<span class="fa-fw fa-solid fa-thumb-tack" title="Marker"></span>' : ''} |
| 1557 | 1587 | ${isSystemPrompt ? '<span class="fa-fw fa-solid fa-square-poll-horizontal" title="Global Prompt"></span>' : ''} |
| 1558 | 1588 | ${isImportantPrompt ? '<span class="fa-fw fa-solid fa-star" title="Important Prompt"></span>' : ''} |
| 1559 | 1589 | ${isUserPrompt ? '<span class="fa-fw fa-solid fa-user" title="UserPreset Prompt"></span>' : ''} |
| 1560 | 1590 | ${isInjectionPrompt ? '<span class="fa-fw fa-solid fa-syringe" title="In-Chat Injection"></span>' : ''} |
| 1561 | 1591 | ${this.isPromptInspectionAllowed(prompt) ? `<a title="${encodedName}" class="prompt-manager-inspect-action">${encodedName}</a>` : `<span title="${encodedName}">${encodedName}</span>`} |
| 1592 | + ${hasRole ? `<span class='fa-solid ${roleIcon}' title='${roleTitle}'></span>` : ''} |
| 1562 | 1593 | ${isInjectionPrompt ? `<small class="prompt-manager-injection-depth">@ ${prompt.injection_depth}</small>` : ''} |
| 1563 | 1594 | ${isOverriddenPrompt ? '<small class="fa-solid fa-address-card prompt-manager-overridden" title="Pulled from a character card"></small>' : ''} |
| 1564 | 1595 | </span> |