feat: Add new widgets and enhance configuration validation
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

- Introduced "nutrition_detail_charts", "recovery_charts_panel", and "progress_photos" widgets to the dashboard.
- Updated widget configuration validation to support new widgets, including chart days for nutrition and recovery charts.
- Enhanced the widget catalog and dashboard layout to include the new features.
- Bumped app_dashboard version to 1.7.0 to reflect these additions and improvements.
This commit is contained in:
Lars committed 2026-04-07 20:58:44 +02:00
1 parent 7f833b2cb1
commit bc91396885
9 files changed
+226 -4

No files matched your search

+6
View File
@@ -18,6 +18,8 @@ WIDGETS_ALLOWING_CONFIG: frozenset[str] = frozenset({
"kpi_board",
"quick_capture",
"trend_kcal_weight",
"nutrition_detail_charts",
"recovery_charts_panel",
})
_QUICK_CAPTURE_KEYS: frozenset[str] = frozenset({
@@ -58,6 +60,10 @@ def validate_widget_entry_config(widget_id: str, raw: Any) -> dict[str, Any]:
return _validate_quick_capture_config(raw)
if widget_id == "trend_kcal_weight":
return _validate_chart_days_only(raw, label="trend_kcal_weight")
if widget_id == "nutrition_detail_charts":
return _validate_chart_days_only(raw, label="nutrition_detail_charts")
if widget_id == "recovery_charts_panel":
return _validate_chart_days_only(raw, label="recovery_charts_panel")
raise ValueError(f"Widget {widget_id}: keine Konfiguration unterstützt")
@@ -71,6 +71,20 @@ def test_quick_capture_visibility():
validate_widget_entry_config("quick_capture", {"extra": 1})
def test_nutrition_detail_charts_days():
assert validate_widget_entry_config("nutrition_detail_charts", {}) == {}
assert validate_widget_entry_config("nutrition_detail_charts", {"chart_days": 60}) == {"chart_days": 60}
with pytest.raises(ValueError):
validate_widget_entry_config("nutrition_detail_charts", {"chart_days": 3})
def test_recovery_charts_panel_days():
assert validate_widget_entry_config("recovery_charts_panel", {}) == {}
assert validate_widget_entry_config("recovery_charts_panel", {"chart_days": 28}) == {"chart_days": 28}
with pytest.raises(ValueError):
validate_widget_entry_config("recovery_charts_panel", {"chart_days": 99})
def test_trend_kcal_weight_chart_days():
assert validate_widget_entry_config("trend_kcal_weight", {}) == {}
assert validate_widget_entry_config("trend_kcal_weight", {"chart_days": 30}) == {"chart_days": 30}
+1 -1
View File
@@ -30,7 +30,7 @@ MODULE_VERSIONS = {
"importdata": "1.0.0",
"membership": "2.1.0",
"workflow": "0.6.0", # Phase 4: End Node Template Engine
"app_dashboard": "1.6.2", # quick_capture: Sichtbarkeit show_* konfigurierbar
"app_dashboard": "1.7.0", # nutrition_detail_charts, recovery_charts_panel, progress_photos
}
CHANGELOG = [
+15
View File
@@ -77,6 +77,21 @@ WIDGET_CATALOG: list[WidgetCatalogEntry] = [
"title": "Ernährung & Aktivität Kurz",
"description": "Ø 7T Kacheln",
},
{
"id": "nutrition_detail_charts",
"title": "Ernährung — Detaillierte Charts",
"description": "Phase-0c NutritionCharts (optional chart_days 7–90, Default 30)",
},
{
"id": "recovery_charts_panel",
"title": "Erholung — Charts R1–R5",
"description": "RecoveryCharts wie Verlauf (optional chart_days 7–90, Default 28)",
},
{
"id": "progress_photos",
"title": "Fortschrittsfotos",
"description": "Galerie der hochgeladenen Fotos",
},
{
"id": "recovery_sleep_rest",
"title": "Erholung",