Merge branch 'persona-improvements' of https://github.com/SillyTavern/SillyTavern into persona-improvements
| @@ -1219,10 +1219,13 @@ function updatePersonaUIStates() { | ||
| 1219 | 1219 | const { isTemporary, info } = getPersonaTemporaryLockInfo(); |
| 1220 | 1220 | if (isTemporary) { |
| 1221 | 1221 | const messageContainer = document.createElement('div'); |
| 1222 | - messageContainer.innerHTML = t`Temporary persona in use.`; | |
| 1222 | + const messageSpan = document.createElement('span'); | |
| 1223 | + messageSpan.textContent = t`Temporary persona in use.`; | |
| 1224 | + messageContainer.appendChild(messageSpan); | |
| 1225 | + messageContainer.classList.add('flex-container', 'alignItemsBaseline'); | |
| 1223 | 1226 | |
| 1224 | 1227 | const infoIcon = document.createElement('i'); |
| 1225 | 1228 | infoIcon.classList.add('fa-solid', 'fa-circle-info', 'opacity50p', 'marginLeft5'); |
| 1226 | 1229 | infoIcon.title = info; |
| 1227 | 1230 | messageContainer.appendChild(infoIcon); |
| 1228 | 1231 | |
| @@ -1525,7 +1528,22 @@ async function duplicatePersona(avatarId) { | ||
| 1525 | 1528 | saveSettingsDebounced(); |
| 1526 | 1529 | } |
| 1527 | 1530 | |
| 1531 | +/** | |
| 1532 | + * If a current user avatar is not bound to persona, bind it. | |
| 1533 | + */ | |
| 1534 | +function migrateNonPersonaUser() { | |
| 1535 | + if (user_avatar in power_user.personas) { | |
| 1536 | + return; | |
| 1537 | + } | |
| 1538 | + | |
| 1539 | + power_user.personas[user_avatar] = name1; | |
| 1540 | + void getOrCreatePersonaDescriptor(); | |
| 1541 | + setPersonaDescription(); | |
| 1542 | + saveSettingsDebounced(); | |
| 1543 | +} | |
| 1544 | + | |
| 1528 | 1545 | export function initPersonas() { |
| 1546 | + migrateNonPersonaUser(); | |
| 1529 | 1547 | $('#persona_delete_button').on('click', deleteUserAvatar); |
| 1530 | 1548 | $('#lock_persona_default').on('click', () => togglePersonaLock('default')); |
| 1531 | 1549 | $('#lock_user_name').on('click', () => togglePersonaLock('chat')); |
| @@ -3028,7 +3028,7 @@ select option:not(:checked) { | ||
| 3028 | 3028 | white-space: nowrap; |
| 3029 | 3029 | margin-right: 10px; |
| 3030 | 3030 | font-size: calc(var(--mainFontSize) * 1.25); |
| 3031 | - color: var(--grey50); | |
| 3031 | + opacity: 0.5; | |
| 3032 | 3032 | } |
| 3033 | 3033 | |
| 3034 | 3034 | #persona_connections_buttons { |