From d98ecce5c37ad115a1944b353b3cacf1cb873229 Mon Sep 17 00:00:00 2001 From: Spicy_Marinara Date: Tue, 14 Oct 2025 14:10:02 +0200 Subject: [PATCH] fix: Append panel directly to body for proper flexbox layout - Changed from $('#sheld').after/before() to $('body').append() - Panel is now a direct child of body element - Works better with SillyTavern's main flexbox layout - CSS handles all positioning (no more DOM position logic) --- index.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index da5b3f4..7f7edef 100644 --- a/index.js +++ b/index.js @@ -299,14 +299,10 @@ async function initUI() { // Load the HTML template using SillyTavern's template system const templateHtml = await renderExtensionTemplateAsync(extensionName, 'template'); - // Add to the appropriate container based on position - if (extensionSettings.panelPosition === 'right') { - // Add as a sidebar next to the chat area (sheld) - $('#sheld').after(templateHtml); - } else { - // Add above the chat area - $('#sheld').before(templateHtml); - } // Cache UI elements + // Append panel to body - positioning handled by CSS + $('body').append(templateHtml); + + // Cache UI elements $panelContainer = $('#rpg-companion-panel'); $userStatsContainer = $('#rpg-user-stats'); $infoBoxContainer = $('#rpg-info-box'); @@ -1105,7 +1101,7 @@ function generateTrackerInstructions(includeHtmlPrompt = true, includeContinuati instructions += '```\n'; instructions += 'Present Characters\n'; instructions += '---\n'; - instructions += `[Present Character's Emoji (do not include ${userName}; state "Unavailable" if no NPCs are present in the scene)]: [Name, Visible Physical State (up to three traits), Observable Demeanor Cue (one trait)] | [Enemy/Neutral/Friend/Lover] | [Internal Monologue (in first person POV, up to three sentences long)]\n`; + instructions += `[Present Character's Emoji (do not include ${userName}; state "Unavailable" if no major characters are present in the scene)]: [Name, Visible Physical State (up to three traits), Observable Demeanor Cue (one trait)] | [Enemy/Neutral/Friend/Lover] | [Internal Monologue (in first person POV, up to three sentences long)]\n`; instructions += '```\n\n'; }