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:
@@ -7684,3 +7684,61 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ========================================
|
||||
Tracker Settings & Widget Integration
|
||||
======================================== */
|
||||
|
||||
/* Tracker Editor Help Text */
|
||||
.rpg-editor-help {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75em;
|
||||
padding: 0.75em 1em;
|
||||
margin: 0 0 1em 0;
|
||||
background: rgba(100, 149, 237, 0.1);
|
||||
border: 1px solid rgba(100, 149, 237, 0.3);
|
||||
border-radius: 0.375em;
|
||||
color: var(--rpg-text);
|
||||
font-size: 0.875em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.rpg-editor-help i {
|
||||
color: #6495ed;
|
||||
font-size: 1.1em;
|
||||
margin-top: 0.15em;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Empty Widget State */
|
||||
.rpg-widget-empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2em 1em;
|
||||
text-align: center;
|
||||
color: var(--rpg-text);
|
||||
opacity: 0.7;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.rpg-widget-empty-state p {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
|
||||
.rpg-widget-empty-state p:first-child {
|
||||
font-size: 1.2em;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.rpg-widget-empty-state a {
|
||||
color: var(--rpg-highlight);
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.rpg-widget-empty-state a:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user