feat(dashboard): integrate tracker editor with widget system
Implemented hierarchical customization where trackerConfig controls content (fields, names, AI instructions) and dashboard controls layout (positioning, tabs, widget instances). Both systems now work together instead of conflicting. **Widget Integration:** - userStatsWidget: Respects trackerConfig for stat names and enable/disable - userStatsWidget: Supports per-widget stat filtering via config.visibleStats - userStatsWidget: Dynamically generates config options from trackerConfig - infoBoxWidgets: All widgets (calendar, weather, temperature, clock, location) check trackerConfig.infoBox.widgets.*.enabled before rendering - Widgets show "disabled" state with link to Tracker Settings when field disabled **Dashboard UI:** - Added Tracker Settings button to dashboard header (sliders icon) - Button opens tracker editor modal for global field configuration - Button positioned next to Edit Layout for clear separation of concerns **Tracker Editor:** - Added help text explaining relationship with dashboard system - Help text clarifies: Tracker Settings = content, Edit Layout = positioning - Styled with info banner at top of modal **Migration:** - Enhanced migrateV1ToV2Dashboard() to respect trackerConfig - Removes userStats widget if all stats disabled in trackerConfig - Removes presentCharacters widget if thoughts disabled in trackerConfig - Ensures smooth upgrade path from v1.x **CSS:** - Added .rpg-editor-help styling for tracker editor help banner - Added .rpg-widget-empty-state for disabled widget messaging - Info-style banner with icon and clear typography **Result:** Two-level customization system: 1. Tracker Settings (global): What fields exist, their names, AI instructions 2. Edit Layout (local): Where widgets appear, per-widget overrides Files modified: - src/systems/dashboard/widgets/userStatsWidget.js (+75 lines) - src/systems/dashboard/widgets/infoBoxWidgets.js (+67 lines) - src/systems/dashboard/dashboardIntegration.js (+15 lines) - src/systems/dashboard/dashboardTemplate.html (+4 lines) - src/systems/dashboard/defaultLayout.js (+22 lines) - template.html (+6 lines) - style.css (+58 lines)
This commit is contained in:
@@ -342,6 +342,12 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Help Text -->
|
||||
<div class="rpg-editor-help">
|
||||
<i class="fa-solid fa-circle-info"></i>
|
||||
<span><strong>Tracker Settings</strong> control available fields, names, and AI instructions. To arrange widgets on your dashboard, use <strong>Edit Layout</strong> mode.</span>
|
||||
</div>
|
||||
|
||||
<div class="rpg-settings-popup-body">
|
||||
<!-- Tab contents will be rendered by JavaScript -->
|
||||
<div id="rpg-editor-tab-userStats" class="rpg-editor-tab-content"></div>
|
||||
|
||||
Reference in New Issue
Block a user