v3.0.1 - Fix thought bubble editing persistence
This commit is contained in:
@@ -7,6 +7,10 @@ An immersive RPG extension for browsers that tracks character stats, scene infor
|
|||||||
|
|
||||||
## 🆕 What's New
|
## 🆕 What's New
|
||||||
|
|
||||||
|
### v3.0.1
|
||||||
|
|
||||||
|
- Small bug fix where you couldn't edit the thought bubble.
|
||||||
|
|
||||||
### v3.0.0
|
### v3.0.0
|
||||||
|
|
||||||
**What's new?**
|
**What's new?**
|
||||||
|
|||||||
+1
-1
@@ -6,6 +6,6 @@
|
|||||||
"js": "index.js",
|
"js": "index.js",
|
||||||
"css": "style.css",
|
"css": "style.css",
|
||||||
"author": "Marinara",
|
"author": "Marinara",
|
||||||
"version": "3.0.0",
|
"version": "3.0.1",
|
||||||
"homePage": "https://github.com/SpicyMarinara/rpg-companion-sillytavern"
|
"homePage": "https://github.com/SpicyMarinara/rpg-companion-sillytavern"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="margin-top: 10px; text-align: center; opacity: 0.6; font-size: 0.85em;">
|
<div style="margin-top: 10px; text-align: center; opacity: 0.6; font-size: 0.85em;">
|
||||||
v3.0.0
|
v3.0.1
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -850,16 +850,50 @@ export function updateCharacterField(characterName, field, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveChatData();
|
saveChatData();
|
||||||
renderThoughts();
|
|
||||||
|
|
||||||
|
// Re-render the sidebar thoughts panel, but skip updating chat bubbles if editing thoughts
|
||||||
const thoughtsFieldName = presentCharsConfig?.thoughts?.name || 'Thoughts';
|
const thoughtsFieldName = presentCharsConfig?.thoughts?.name || 'Thoughts';
|
||||||
if (field === thoughtsFieldName) {
|
const isEditingThoughts = field === thoughtsFieldName || field === 'thoughts';
|
||||||
setTimeout(() => updateChatThoughts(), 100);
|
|
||||||
|
if (!isEditingThoughts) {
|
||||||
|
renderThoughts();
|
||||||
} else {
|
} 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.
|
* Updates or removes thought overlays in the chat.
|
||||||
* Creates floating thought bubbles positioned near character avatars.
|
* Creates floating thought bubbles positioned near character avatars.
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ export function getSettingsModal() {
|
|||||||
* Checks if user has already seen this version's welcome screen
|
* Checks if user has already seen this version's welcome screen
|
||||||
*/
|
*/
|
||||||
export function showWelcomeModalIfNeeded() {
|
export function showWelcomeModalIfNeeded() {
|
||||||
const WELCOME_VERSION = '3.0.0';
|
const WELCOME_VERSION = '3.0.1';
|
||||||
const STORAGE_KEY = 'rpg_companion_welcome_seen';
|
const STORAGE_KEY = 'rpg_companion_welcome_seen';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user