From 658b911d12dedee15b0490fbafc20d8d6bb14771 Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Fri, 17 Oct 2025 14:35:55 +1100 Subject: [PATCH] style: integrate upstream font-size and layout improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Folds in changes from commits 6d97992, cc53c69, 6987c0c: - Update stat label/value font sizes (clamp 0.9-1vw → 0.5-0.7vw) - Update inventory items font size (clamp 0.4-0.6vw → 0.7-0.6vw) - Center dice save button with auto margins - Add debug console.log for committedTrackerData - Comment out verbose console logs for plot progression and persona avatar - Clarify prompt instruction to remove brackets --- src/systems/generation/injector.js | 1 + src/systems/generation/promptBuilder.js | 2 +- src/systems/integration/sillytavern.js | 12 ++++++------ style.css | 8 +++++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/systems/generation/injector.js b/src/systems/generation/injector.js index 2f789ae..c98d447 100644 --- a/src/systems/generation/injector.js +++ b/src/systems/generation/injector.js @@ -32,6 +32,7 @@ export function onGenerationStarted(type, data) { // console.log('[RPG Companion] enabled:', extensionSettings.enabled); // console.log('[RPG Companion] generationMode:', extensionSettings.generationMode); // console.log('[RPG Companion] ⚡ EVENT: onGenerationStarted - lastActionWasSwipe =', lastActionWasSwipe, '| isGenerating =', isGenerating); + // console.log('[RPG Companion] Committed Prompt:', committedTrackerData); // Skip tracker injection for image generation requests if (data?.quietImage) { diff --git a/src/systems/generation/promptBuilder.js b/src/systems/generation/promptBuilder.js index 37fd5f3..9e7a5c2 100644 --- a/src/systems/generation/promptBuilder.js +++ b/src/systems/generation/promptBuilder.js @@ -51,7 +51,7 @@ export function generateTrackerInstructions(includeHtmlPrompt = true, includeCon // Only add tracker instructions if at least one tracker is enabled if (hasAnyTrackers) { // Universal instruction header - instructions += `\nYou must start your response with an appropriate update to the trackers in EXACTLY the same format as below, enclosed in separate Markdown code fences. Replace X with proper numbers and placeholders in [brackets] with in-world details ${userName} perceives about the current scene and the present characters. Consider the last trackers in the conversation (if they exist). Manage them accordingly and realistically; raise, lower, change, or keep the values unchanged based on the user's actions, the passage of time, and logical consequences:\n`; + instructions += `\nYou must start your response with an appropriate update to the trackers in EXACTLY the same format as below, enclosed in separate Markdown code fences. Replace X with proper numbers and placeholders in [brackets] (while removing the brackets themselves) with in-world details ${userName} perceives about the current scene and the present characters. Consider the last trackers in the conversation (if they exist). Manage them accordingly and realistically; raise, lower, change, or keep the values unchanged based on the user's actions, the passage of time, and logical consequences:\n`; // Add format specifications for each enabled tracker if (extensionSettings.showUserStats) { diff --git a/src/systems/integration/sillytavern.js b/src/systems/integration/sillytavern.js index 8fce457..1b6c9f4 100644 --- a/src/systems/integration/sillytavern.js +++ b/src/systems/integration/sillytavern.js @@ -185,7 +185,7 @@ export async function onMessageReceived(data) { // Note: No need to clear extension prompt since we used quiet_prompt option if (isPlotProgression) { setIsPlotProgression(false); - console.log('[RPG Companion] Plot progression generation completed'); + // console.log('[RPG Companion] Plot progression generation completed'); } } @@ -291,7 +291,7 @@ export function onMessageSwiped(messageIndex) { export function updatePersonaAvatar() { const portraitImg = document.querySelector('.rpg-user-portrait'); if (!portraitImg) { - console.log('[RPG Companion] Portrait image element not found in DOM'); + // console.log('[RPG Companion] Portrait image element not found in DOM'); return; } @@ -299,7 +299,7 @@ export function updatePersonaAvatar() { const context = getContext(); const currentUserAvatar = context.user_avatar || user_avatar; - console.log('[RPG Companion] Attempting to update persona avatar:', currentUserAvatar); + // console.log('[RPG Companion] Attempting to update persona avatar:', currentUserAvatar); // Try to get a valid thumbnail URL using our safe helper if (currentUserAvatar) { @@ -308,14 +308,14 @@ export function updatePersonaAvatar() { if (thumbnailUrl) { // Only update the src if we got a valid URL portraitImg.src = thumbnailUrl; - console.log('[RPG Companion] Persona avatar updated successfully'); + // console.log('[RPG Companion] Persona avatar updated successfully'); } else { // Don't update the src if we couldn't get a valid URL // This prevents 400 errors and keeps the existing image - console.warn('[RPG Companion] Could not get valid thumbnail URL for persona avatar, keeping existing image'); + // console.warn('[RPG Companion] Could not get valid thumbnail URL for persona avatar, keeping existing image'); } } else { - console.log('[RPG Companion] No user avatar configured, keeping existing image'); + // console.log('[RPG Companion] No user avatar configured, keeping existing image'); } } diff --git a/style.css b/style.css index a840b68..40551a4 100644 --- a/style.css +++ b/style.css @@ -639,7 +639,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld { } .rpg-inventory-items { - font-size: clamp(0.4vw, 0.5vw, 0.6vw); + font-size: clamp(0.7vw, 0.5vw, 0.6vw); color: var(--rpg-text); line-height: 1.3; overflow-y: auto; @@ -746,7 +746,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld { .rpg-stat-label { min-width: 4.062rem; - font-size: clamp(0.9vw, 0.95vw, 1vw); + font-size: clamp(0.5vw, 0.6vw, 0.7vw); font-weight: 600; text-align: left; color: var(--rpg-text); @@ -776,7 +776,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld { .rpg-stat-value { color: #fff; - font-size: clamp(0.9vw, 0.95vw, 1vw); + font-size: clamp(0.5vw, 0.6vw, 0.7vw); font-weight: bold; min-width: 1.875rem; text-align: right; @@ -2545,6 +2545,8 @@ body:has(.rpg-panel.rpg-position-left) #sheld { .rpg-dice-save-btn { max-width: 200px; + margin-left: auto; + margin-right: auto; } }