v3.0.1 - Fix thought bubble editing persistence

This commit is contained in:
Spicy_Marinara
2026-01-07 20:25:49 +01:00
parent 93327e4416
commit 718d45095d
5 changed files with 45 additions and 7 deletions
+4
View File
@@ -7,6 +7,10 @@ An immersive RPG extension for browsers that tracks character stats, scene infor
## 🆕 What's New
### v3.0.1
- Small bug fix where you couldn't edit the thought bubble.
### v3.0.0
**What's new?**
+1 -1
View File
@@ -6,6 +6,6 @@
"js": "index.js",
"css": "style.css",
"author": "Marinara",
"version": "3.0.0",
"version": "3.0.1",
"homePage": "https://github.com/SpicyMarinara/rpg-companion-sillytavern"
}
+1 -1
View File
@@ -39,7 +39,7 @@
</div>
<div style="margin-top: 10px; text-align: center; opacity: 0.6; font-size: 0.85em;">
v3.0.0
v3.0.1
</div>
</div>
</div>
+38 -4
View File
@@ -850,16 +850,50 @@ export function updateCharacterField(characterName, field, value) {
}
saveChatData();
renderThoughts();
// Re-render the sidebar thoughts panel, but skip updating chat bubbles if editing thoughts
const thoughtsFieldName = presentCharsConfig?.thoughts?.name || 'Thoughts';
if (field === thoughtsFieldName) {
setTimeout(() => updateChatThoughts(), 100);
const isEditingThoughts = field === thoughtsFieldName || field === 'thoughts';
if (!isEditingThoughts) {
renderThoughts();
} else {
updateChatThoughts();
// Only update sidebar, don't trigger chat bubble refresh
$thoughtsContainer.find('.rpg-editable').off('blur');
renderThoughtsSidebarOnly();
$thoughtsContainer.find('.rpg-editable').on('blur', function() {
const char = $(this).data('character');
const fld = $(this).data('field');
const val = $(this).text().trim();
updateCharacterField(char, fld, val);
});
}
}
/**
* Renders only the sidebar thoughts panel without updating chat bubbles
*/
function renderThoughtsSidebarOnly() {
if (!extensionSettings.showCharacterThoughts || !$thoughtsContainer) {
return;
}
// This is a simplified version that only updates the sidebar
// Copy the rendering logic from renderThoughts but skip the updateChatThoughts call
const thoughtsData = lastGeneratedData.characterThoughts || committedTrackerData.characterThoughts;
if (!thoughtsData) {
$thoughtsContainer.html('<div class="rpg-inventory-empty">No character data generated yet</div>');
return;
}
// Re-render sidebar content (this would be the full logic from renderThoughts)
// For now, just call renderThoughts but set a flag
const originalShowInChat = extensionSettings.showThoughtsInChat;
extensionSettings.showThoughtsInChat = false;
renderThoughts();
extensionSettings.showThoughtsInChat = originalShowInChat;
}
/**
* Updates or removes thought overlays in the chat.
* Creates floating thought bubbles positioned near character avatars.
+1 -1
View File
@@ -587,7 +587,7 @@ export function getSettingsModal() {
* Checks if user has already seen this version's welcome screen
*/
export function showWelcomeModalIfNeeded() {
const WELCOME_VERSION = '3.0.0';
const WELCOME_VERSION = '3.0.1';
const STORAGE_KEY = 'rpg_companion_welcome_seen';
try {