feat: Enhance dashboard widget configuration and introduce new widgets
- Updated the dashboard layout schema to include new widgets: DashboardGreeting, QuickWeightToday, BodyStatStrip, StatusPills, ProfileGoalsProgress, TrendKcalWeight, NutritionActivitySummary, RecoverySleepRest, and TrainingTypeDistribution. - Improved widget configuration validation to support new features, including chart days for trend and distribution widgets. - Refactored the default lab layout to align with the updated widget catalog and ensure proper default activation. - Bumped app_dashboard version to 1.6.0 to reflect the addition of new widgets and configuration enhancements.
This commit is contained in:
1 parent
c0c512e942
commit
3d498d03c1
28 files changed
+1487
-243
No files matched your search
@@ -10,7 +10,7 @@ from typing import Any, Literal
|
||||
from pydantic import BaseModel, Field, field_validator, model_validator
|
||||
|
||||
from dashboard_widget_config import validate_widget_entry_config
|
||||
from widget_catalog import ALLOWED_WIDGET_IDS, WIDGET_CATALOG
|
||||
from widget_catalog import ALLOWED_WIDGET_IDS, DEFAULT_LAB_WIDGET_IDS, WIDGET_CATALOG
|
||||
|
||||
# Abwärtskompatibel (Tests importieren weiterhin aus diesem Modul)
|
||||
__all__ = [
|
||||
@@ -23,9 +23,10 @@ __all__ = [
|
||||
|
||||
|
||||
def default_layout_dict() -> dict[str, Any]:
|
||||
on = DEFAULT_LAB_WIDGET_IDS
|
||||
return {
|
||||
"version": 1,
|
||||
"widgets": [{"id": e["id"], "enabled": True} for e in WIDGET_CATALOG],
|
||||
"widgets": [{"id": e["id"], "enabled": e["id"] in on} for e in WIDGET_CATALOG],
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user