fix(dashboard): sync widget data and fix refresh on chat load

- Update onMessageReceived to populate extensionSettings.infoBoxData and characterThoughts for dashboard widgets
- Update updateRPGData (separate mode) with same extensionSettings population
- Add refreshDashboard() calls after data updates in both generation paths
- Fix onCharacterChanged to populate extensionSettings from loaded chat data
- Fix refreshDashboard() to use correct property name (registry not widgetRegistry)
- Reduce mood and weather widget font sizes to fit in 1x1 layout

This fixes Scene tab widgets not updating when receiving messages or loading chats from welcome screen.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-24 12:44:11 +11:00
parent 0d179d22fc
commit 63a02fd197
4 changed files with 58 additions and 16 deletions
@@ -390,11 +390,15 @@ export function createDefaultLayout(manager) {
* Refresh all widgets (called after data updates)
*/
export function refreshDashboard() {
if (dashboardManager) {
// Get all active widgets and re-render them
const widgets = dashboardManager.getAllWidgets();
widgets.forEach(widget => {
dashboardManager.renderWidget(widget.id);
if (dashboardManager && dashboardManager.widgets) {
// Re-render all active widgets by accessing the widgets Map directly
dashboardManager.widgets.forEach((widgetData, widgetId) => {
// Get the widget definition from registry
const definition = dashboardManager.registry.get(widgetData.widget.type);
if (definition && widgetData.element) {
// Re-render the widget content
dashboardManager.renderWidgetContent(widgetData.element, widgetData.widget, definition);
}
});
}
}