From 1ad0154f0f41ece40b96e78402b62eafb63a36ee Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Wed, 25 Sep 2024 04:55:48 +0200 Subject: [PATCH 1/5] Fix classify not using extension-defined prompt --- public/scripts/extensions/expressions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/extensions/expressions/index.js b/public/scripts/extensions/expressions/index.js index 00eb75a6f..71be1e422 100644 --- a/public/scripts/extensions/expressions/index.js +++ b/public/scripts/extensions/expressions/index.js @@ -1161,7 +1161,7 @@ export async function getExpressionLabel(text, expressionsApi = extension_settin } const expressionsList = await getExpressionsList(); - const prompt = substituteParamsExtended(String(customPrompt), { labels: expressionsList }) || await getLlmPrompt(expressionsList); + const prompt = substituteParamsExtended(customPrompt, { labels: expressionsList }) || await getLlmPrompt(expressionsList); let functionResult = null; eventSource.once(event_types.TEXT_COMPLETION_SETTINGS_READY, onTextGenSettingsReady); eventSource.once(event_types.LLM_FUNCTION_TOOL_REGISTER, onFunctionToolRegister); From 5a4e23f62f12d3b91d01d261d52a3e78abff8492 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:01:34 +0000 Subject: [PATCH 2/5] Fix Novel bias not displaying --- public/scripts/nai-settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/nai-settings.js b/public/scripts/nai-settings.js index cbe0934fa..e24353499 100644 --- a/public/scripts/nai-settings.js +++ b/public/scripts/nai-settings.js @@ -74,7 +74,7 @@ const samplers = { let novel_data = null; let badWordsCache = {}; -const BIAS_KEY = '#novel_api-settings'; +const BIAS_KEY = '#range_block_novel'; export function setNovelData(data) { novel_data = data; From d9a863810954097838d670b00b271007ce792cb8 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:09:13 +0000 Subject: [PATCH 3/5] Don't silence migration errors + add backups Closes #2900 --- src/users.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/users.js b/src/users.js index 618641bab..7ef260ac0 100644 --- a/src/users.js +++ b/src/users.js @@ -347,6 +347,8 @@ async function migrateSystemPrompts() { if (fs.existsSync(migrateMarker)) { continue; } + const backupsPath = path.join(directory.backups, '_sysprompt'); + fs.mkdirSync(backupsPath, { recursive: true }); const defaultPrompts = await getDefaultSystemPrompts(); const instucts = fs.readdirSync(directory.instruct); let migratedPrompts = []; @@ -356,6 +358,8 @@ async function migrateSystemPrompts() { if (path.extname(instruct) === '.json' && !fs.existsSync(sysPromptPath)) { const instructData = JSON.parse(fs.readFileSync(instructPath, 'utf8')); if ('system_prompt' in instructData && 'name' in instructData) { + const backupPath = path.join(backupsPath, `${instructData.name}.json`); + fs.cpSync(instructPath, backupPath, { force: true }); const syspromptData = { name: instructData.name, content: instructData.system_prompt }; migratedPrompts.push(syspromptData); delete instructData.system_prompt; @@ -374,8 +378,8 @@ async function migrateSystemPrompts() { console.log(`Migrated system prompt ${sysPromptData.name} for ${directory.root.split(path.sep).pop()}`); } writeFileAtomicSync(migrateMarker, ''); - } catch { - // Ignore errors + } catch (error) { + console.error('Error migrating system prompts:', error); } } } From b01ae4e0ea4783ef13acfd1efc9f10e91752817f Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:58:07 +0000 Subject: [PATCH 4/5] Fix sysprompts set with commands --- public/scripts/sysprompt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/sysprompt.js b/public/scripts/sysprompt.js index 5b1ef89bb..6d54f0220 100644 --- a/public/scripts/sysprompt.js +++ b/public/scripts/sysprompt.js @@ -143,7 +143,7 @@ function selectSystemPromptCallback(args, name) { foundName = result[0].item; } - $select.val(foundName).trigger('input'); + $select.val(foundName).trigger('change'); !quiet && toastr.success(`System prompt "${foundName}" selected`); return foundName; } From 4c159dfb5024eb2be18a407e4f6a259be89a0fa1 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:56:19 +0000 Subject: [PATCH 5/5] Hotfix: Chrome 129 wide popup sizing --- public/style.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/style.css b/public/style.css index afbd231d0..dd716d0f6 100644 --- a/public/style.css +++ b/public/style.css @@ -3245,8 +3245,9 @@ grammarly-extension { } .wide_dialogue_popup { - aspect-ratio: 1 / 1; - width: unset !important; + /* FIXME: Chrome 129 broke max-height for aspect-ratio sized elements */ + /* aspect-ratio: 1 / 1; */ + /* width: unset !important; */ min-width: var(--sheldWidth); }