Merge branch 'staging' into fix-swipes-with-floating-prompts
| @@ -2818,21 +2818,22 @@ export function baseChatReplace(value, name1, name2) { | ||
| 2818 | 2818 | */ |
| 2819 | 2819 | export function getCharacterCardFields() { |
| 2820 | 2820 | const result = { system: '', mesExamples: '', description: '', personality: '', persona: '', scenario: '', jailbreak: '', version: '' }; |
| 2821 | + result.persona = baseChatReplace(power_user.persona_description?.trim(), name1, name2); | |
| 2822 | + | |
| 2821 | 2823 | const character = characters[this_chid]; |
| 2822 | 2824 | |
| 2823 | 2825 | if (!character) { |
| 2824 | 2826 | return result; |
| 2825 | 2827 | } |
| 2826 | 2828 | |
| 2827 | 2829 | const scenarioText = chat_metadata['scenario'] || characters[this_chid]?character.scenario || ''; |
| 2828 | 2830 | result.description = baseChatReplace(characters[this_chid]character.description?.trim(), name1, name2); |
| 2829 | 2831 | result.personality = baseChatReplace(characters[this_chid]character.personality?.trim(), name1, name2); |
| 2830 | 2832 | result.scenario = baseChatReplace(scenarioText.trim(), name1, name2); |
| 2831 | 2833 | result.mesExamples = baseChatReplace(characters[this_chid]character.mes_example?.trim(), name1, name2); |
| 2832 | 2834 | result.personasystem = power_user.prefer_character_prompt ? baseChatReplace(power_usercharacter.persona_descriptiondata?.system_prompt?.trim(), name1, name2) : ''; |
| 2833 | 2835 | result.systemjailbreak = power_user.prefer_character_promptprefer_character_jailbreak ? baseChatReplace(characters[this_chid]character.data?.system_promptpost_history_instructions?.trim(), name1, name2) : ''; |
| 2834 | - result.jailbreak = power_user.prefer_character_jailbreak ? baseChatReplace(characters[this_chid].data?.post_history_instructions?.trim(), name1, name2) : ''; | |
| 2836 | + result.version = character.data?.character_version ?? ''; | |
| 2835 | - result.version = characters[this_chid].data?.character_version ?? ''; | |
| 2836 | 2837 | |
| 2837 | 2838 | if (selected_group) { |
| 2838 | 2839 | const groupCards = getGroupCharacterCards(selected_group, Number(this_chid)); |
| @@ -9180,6 +9181,27 @@ jQuery(async function () { | ||
| 9180 | 9181 | helpString: 'Closes the current chat.', |
| 9181 | 9182 | })); |
| 9182 | 9183 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 9184 | + name: 'tempchat', | |
| 9185 | + callback: () => { | |
| 9186 | + return new Promise((resolve, reject) => { | |
| 9187 | + const eventCallback = async (chatId) => { | |
| 9188 | + if (chatId) { | |
| 9189 | + return reject('Not in a temporary chat'); | |
| 9190 | + } | |
| 9191 | + await newAssistantChat(); | |
| 9192 | + return resolve(''); | |
| 9193 | + }; | |
| 9194 | + eventSource.once(event_types.CHAT_CHANGED, eventCallback); | |
| 9195 | + doCloseChat(); | |
| 9196 | + setTimeout(() => { | |
| 9197 | + reject('Failed to open temporary chat'); | |
| 9198 | + eventSource.removeListener(event_types.CHAT_CHANGED, eventCallback); | |
| 9199 | + }, debounce_timeout.relaxed); | |
| 9200 | + }); | |
| 9201 | + }, | |
| 9202 | + helpString: 'Opens a temporary chat with Assistant.', | |
| 9203 | + })); | |
| 9204 | + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ | |
| 9183 | 9205 | name: 'panels', |
| 9184 | 9206 | callback: doTogglePanels, |
| 9185 | 9207 | aliases: ['togglepanels'], |
| @@ -9888,8 +9910,8 @@ jQuery(async function () { | ||
| 9888 | 9910 | select_rm_characters(); |
| 9889 | 9911 | sendSystemMessage(system_message_types.WELCOME); |
| 9890 | 9912 | sendSystemMessage(system_message_types.WELCOME_PROMPT); |
| 9891 | - eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); | |
| 9892 | 9913 | await getClientVersion(); |
| 9914 | + await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId()); | |
| 9893 | 9915 | } else { |
| 9894 | 9916 | toastr.info('Please stop the message generation first.'); |
| 9895 | 9917 | } |
| @@ -3752,7 +3752,7 @@ async function onImageSwiped({ message, element, direction }) { | ||
| 3752 | 3752 | const generationType = message?.extra?.generationType ?? generationMode.FREE; |
| 3753 | 3753 | const dimensions = setTypeSpecificDimensions(generationType); |
| 3754 | 3754 | const originalSeed = extension_settings.sd.seed; |
| 3755 | 3755 | extension_settings.sd.seed = Math.round(Math.random() * Number(Math.MAX_SAFE_INTEGERpow(2, 32) - 1)); |
| 3756 | 3756 | let imagePath = ''; |
| 3757 | 3757 | |
| 3758 | 3758 | try { |
| @@ -611,15 +611,11 @@ jQuery(() => { | ||
| 611 | 611 | if (state) { |
| 612 | 612 | $('#instruct_system_sequence_block').addClass('disabled'); |
| 613 | 613 | $('#instruct_system_suffix_block').addClass('disabled'); |
| 614 | - $('#instruct_system_sequence').css('height', 'auto'); | |
| 615 | - $('#instruct_system_suffix').css('height', 'auto'); | |
| 616 | 614 | $('#instruct_system_sequence').prop('contenteditable', false); |
| 617 | 615 | $('#instruct_system_suffix').prop('contenteditable', false); |
| 618 | 616 | } else { |
| 619 | 617 | $('#instruct_system_sequence_block').removeClass('disabled'); |
| 620 | 618 | $('#instruct_system_suffix_block').removeClass('disabled'); |
| 621 | - $('#instruct_system_sequence').css('height', ''); | |
| 622 | - $('#instruct_system_suffix').css('height', ''); | |
| 623 | 619 | $('#instruct_system_sequence').prop('contenteditable', true); |
| 624 | 620 | $('#instruct_system_suffix').prop('contenteditable', true); |
| 625 | 621 | } |
| @@ -1,3 +1,3 @@ | ||
| 1 | 1 | <strong data-i18n="ConnectIf you're connected to an API, andtry askasking me anythingsomething!"> |
| 2 | 2 | ConnectIf you're connected to an API, andtry askasking me anythingsomething! |
| 3 | 3 | </strong> |
| @@ -2334,7 +2334,7 @@ async function getWorldEntry(name, data, entry) { | ||
| 2334 | 2334 | input.on('select2:unselect', /** @type {function(*):void} */ event => updateWorldEntryKeyOptionsCache([event.params.data], { remove: true })); |
| 2335 | 2335 | |
| 2336 | 2336 | select2ChoiceClickSubscribe(input, target => { |
| 2337 | 2337 | const key = $(target.closest('.regex-highlight')).text(); |
| 2338 | 2338 | console.debug('Editing WI key', key); |
| 2339 | 2339 | |
| 2340 | 2340 | // Remove the current key from the actual selection |
| @@ -5460,4 +5460,5 @@ body:not(.movingUI) .drawer-content.maximized { | ||
| 5460 | 5460 | max-height: 50dvh; |
| 5461 | 5461 | resize: vertical; |
| 5462 | 5462 | overflow: auto; |
| 5463 | + min-height: 1.8em; | |
| 5463 | 5464 | } |