Files
rpg-companion-sillytavern/src/systems
Lucas 'Paperboy' Rose-Winters 15ead7c21b fix(widgets): resolve data reading issues for Recent Events and Present Characters
Issue 1: Recent Events widget not updating
Root cause: Widget was reading from settings.committedTrackerData.infoBox (only updated on first gen) instead of using getInfoBoxData() from dependencies (updated every gen)

Fix:
- Changed registerRecentEventsWidget to use getInfoBoxData() pattern
- Updated render() to destructure getInfoBoxData from dependencies
- Updated attachRecentEventsHandlers to accept dependencies
- Rewrote updateRecentEvent to use getInfoBoxData/setInfoBoxData/onDataChange
- Now matches pattern used by other infoBox widgets (calendar, weather, etc.)

Issue 2: Present Characters showing 'Details' + granny emoji
Root cause: Parser expected OLD single-line format but AI returns NEW multi-line format from tracker customization system

OLD format: 🧐: Name, Traits | Relationship | Thoughts
NEW format:
- Name
Details: 🧐 | Traits
Relationship: Type
Thoughts: Text

Fix:
- Rewrote parseCharacterThoughts() to handle multi-line format:
  - Detects character entries starting with `-`
  - Parses Details: line for emoji and traits
  - Parses Relationship: line
  - Parses Thoughts: line (removes surrounding quotes)
  - Skips optional Stats: line
- Kept legacy single-line format as fallback for backward compatibility

Data flow verified:
AI response → parseResponse() → extensionSettings.infoBoxData → getInfoBoxData() → widget render()

Result:
 Recent Events displays: "Morning meditation, bathing, dressing"
 Present Characters displays: Full character cards with emoji, traits, relationship, thoughts
 Both widgets update on every AI generation
 Backward compatible with old format
2025-11-02 18:11:41 +11:00
..