Fix: Strip thinking tags from parser and persist tracker data on page refresh
- Added removal of <think> and <thinking> tags from AI responses before parsing - Fixed Info Box display to use committedTrackerData as fallback after page refresh - Fixed Present Characters display to use committedTrackerData as fallback after page refresh - Fixed 4-part character format handling in updateCharacterField to preserve thoughts - Ensures Recent Events and all tracker data persist correctly across page reloads
This commit is contained in:
@@ -64,8 +64,11 @@ export function renderInfoBox() {
|
||||
$infoBoxContainer.addClass('rpg-content-updating');
|
||||
}
|
||||
|
||||
// Use committedTrackerData as fallback if lastGeneratedData is empty (e.g., after page refresh)
|
||||
const infoBoxData = lastGeneratedData.infoBox || committedTrackerData.infoBox;
|
||||
|
||||
// If no data yet, show placeholder
|
||||
if (!lastGeneratedData.infoBox) {
|
||||
if (!infoBoxData) {
|
||||
const placeholderHtml = `
|
||||
<div class="rpg-dashboard rpg-dashboard-row-1">
|
||||
<div class="rpg-dashboard-widget rpg-placeholder-widget">
|
||||
@@ -81,10 +84,10 @@ export function renderInfoBox() {
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log('[RPG Companion] renderInfoBox called with data:', lastGeneratedData.infoBox);
|
||||
// console.log('[RPG Companion] renderInfoBox called with data:', infoBoxData);
|
||||
|
||||
// Parse the info box data
|
||||
const lines = lastGeneratedData.infoBox.split('\n');
|
||||
const lines = infoBoxData.split('\n');
|
||||
// console.log('[RPG Companion] Info Box split into lines:', lines);
|
||||
const data = {
|
||||
date: '',
|
||||
|
||||
Reference in New Issue
Block a user