Add weekly consistency goals

This commit is contained in:
hz
2026-08-01 04:14:39 -05:00
parent ecd5da9162
commit 300b230c03
16 changed files with 589 additions and 2 deletions
+9
View File
@@ -10,14 +10,21 @@ func _initialize() -> void:
func _run() -> void:
var dashboard_service = root.get_node("DashboardService")
var mission_service = root.get_node("DailyMissionService")
var weekly_goal_service = root.get_node("WeeklyGoalService")
var prior_data: Dictionary = dashboard_service.data
var prior_missions: Dictionary = mission_service.state
var prior_weekly_goal: Dictionary = weekly_goal_service.state
dashboard_service.data = _dashboard_data()
mission_service.state = {"replacementAvailable": true, "missions": [
{"id": "m1", "type": "due_reviews", "title": "Complete 3 scheduled reviews", "target": 3, "progress": 1, "completed": false},
{"id": "m2", "type": "weak_system_correct", "title": "Get 3 correct", "target": 3, "progress": 3, "completed": true},
{"id": "m3", "type": "difficulty_four_correct", "title": "Get 3 hard correct", "target": 3, "progress": 0, "completed": false}
]}
weekly_goal_service.state = {"completed": false, "suggestedSystem": "Cardiovascular System", "components": [
{"type": "active_days", "label": "Study on 4 different days", "progress": 2, "target": 4, "completed": false},
{"type": "system_breadth", "label": "Study 3 Step 3 systems", "progress": 1, "target": 3, "completed": false},
{"type": "hard_correct", "label": "Get 5 hard answers correct", "progress": 3, "target": 5, "completed": false}
]}
var dashboard = load("res://scripts/ui/dashboard_screen.gd").new()
dashboard.size = Vector2(1280, 900)
root.add_child(dashboard)
@@ -30,6 +37,7 @@ func _run() -> void:
var first_mastery_row: BoxContainer = dashboard.mastery_rows[0]
_assert(not first_mastery_row.vertical, "desktop mastery rows should remain horizontal")
_assert(dashboard.mission_rows.size() == 3, "dashboard should render all three daily missions")
_assert(dashboard.weekly_goal_content.get_child_count() == 5, "dashboard should render the weekly header, three components, and reward note")
var first_mission_row: BoxContainer = dashboard.mission_rows[0]
_assert(not first_mission_row.vertical, "desktop mission rows should remain horizontal")
dashboard.size = Vector2(640, 900)
@@ -45,6 +53,7 @@ func _run() -> void:
dashboard.queue_free()
dashboard_service.data = prior_data
mission_service.state = prior_missions
weekly_goal_service.state = prior_weekly_goal
await process_frame
quit(1 if failures > 0 else 0)