Merge branch 'staging' into fix-swipes-with-floating-prompts

26635f9f10207f2300b8381294ccd9c2acc61a6d

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

6 files changed, +36 -17Ignore whitespace
public/script.js+31 -9
@@ -2818,21 +2818,22 @@ export function baseChatReplace(value, name1, name2) {
28182818 */
28192819export function getCharacterCardFields() {
28202820 const result = { system: '', mesExamples: '', description: '', personality: '', persona: '', scenario: '', jailbreak: '', version: '' };
2821+ result.persona = baseChatReplace(power_user.persona_description?.trim(), name1, name2);
2822+
28212823 const character = characters[this_chid];
28222824
28232825 if (!character) {
28242826 return result;
28252827 }
28262828
28272829 const scenarioText = chat_metadata['scenario'] || characters[this_chid]?character.scenario || '';
28282830 result.description = baseChatReplace(characters[this_chid]character.description?.trim(), name1, name2);
28292831 result.personality = baseChatReplace(characters[this_chid]character.personality?.trim(), name1, name2);
28302832 result.scenario = baseChatReplace(scenarioText.trim(), name1, name2);
28312833 result.mesExamples = baseChatReplace(characters[this_chid]character.mes_example?.trim(), name1, name2);
28322834 result.personasystem = power_user.prefer_character_prompt ? baseChatReplace(power_usercharacter.persona_descriptiondata?.system_prompt?.trim(), name1, name2) : '';
28332835 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 ?? '';
28362837
28372838 if (selected_group) {
28382839 const groupCards = getGroupCharacterCards(selected_group, Number(this_chid));
@@ -9180,6 +9181,27 @@ jQuery(async function () {
91809181 helpString: 'Closes the current chat.',
91819182 }));
91829183 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({
91839205 name: 'panels',
91849206 callback: doTogglePanels,
91859207 aliases: ['togglepanels'],
@@ -9888,8 +9910,8 @@ jQuery(async function () {
98889910 select_rm_characters();
98899911 sendSystemMessage(system_message_types.WELCOME);
98909912 sendSystemMessage(system_message_types.WELCOME_PROMPT);
9891- eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
98929913 await getClientVersion();
9914+ await eventSource.emit(event_types.CHAT_CHANGED, getCurrentChatId());
98939915 } else {
98949916 toastr.info('Please stop the message generation first.');
98959917 }
public/scripts/extensions/stable-diffusion/index.js+1 -1
@@ -3752,7 +3752,7 @@ async function onImageSwiped({ message, element, direction }) {
37523752 const generationType = message?.extra?.generationType ?? generationMode.FREE;
37533753 const dimensions = setTypeSpecificDimensions(generationType);
37543754 const originalSeed = extension_settings.sd.seed;
37553755 extension_settings.sd.seed = Math.round(Math.random() * Number(Math.MAX_SAFE_INTEGERpow(2, 32) - 1));
37563756 let imagePath = '';
37573757
37583758 try {
public/scripts/instruct-mode.js+0 -4
@@ -611,15 +611,11 @@ jQuery(() => {
611611 if (state) {
612612 $('#instruct_system_sequence_block').addClass('disabled');
613613 $('#instruct_system_suffix_block').addClass('disabled');
614- $('#instruct_system_sequence').css('height', 'auto');
615- $('#instruct_system_suffix').css('height', 'auto');
616614 $('#instruct_system_sequence').prop('contenteditable', false);
617615 $('#instruct_system_suffix').prop('contenteditable', false);
618616 } else {
619617 $('#instruct_system_sequence_block').removeClass('disabled');
620618 $('#instruct_system_suffix_block').removeClass('disabled');
621- $('#instruct_system_sequence').css('height', '');
622- $('#instruct_system_suffix').css('height', '');
623619 $('#instruct_system_sequence').prop('contenteditable', true);
624620 $('#instruct_system_suffix').prop('contenteditable', true);
625621 }
public/scripts/templates/welcomePrompt.html+2 -2
@@ -1,3 +1,3 @@
11<strong data-i18n="ConnectIf you're connected to an API, andtry askasking me anythingsomething!">
22 ConnectIf you're connected to an API, andtry askasking me anythingsomething!
33</strong>
public/scripts/world-info.js+1 -1
@@ -2334,7 +2334,7 @@ async function getWorldEntry(name, data, entry) {
23342334 input.on('select2:unselect', /** @type {function(*):void} */ event => updateWorldEntryKeyOptionsCache([event.params.data], { remove: true }));
23352335
23362336 select2ChoiceClickSubscribe(input, target => {
23372337 const key = $(target.closest('.regex-highlight')).text();
23382338 console.debug('Editing WI key', key);
23392339
23402340 // Remove the current key from the actual selection
public/style.css+1 -0
@@ -5460,4 +5460,5 @@ body:not(.movingUI) .drawer-content.maximized {
54605460 max-height: 50dvh;
54615461 resize: vertical;
54625462 overflow: auto;
5463+ min-height: 1.8em;
54635464}