Add daily study missions

This commit is contained in:
hz
2026-08-01 04:02:24 -05:00
parent 2bd2628009
commit ecd5da9162
20 changed files with 619 additions and 6 deletions
+12
View File
@@ -9,8 +9,15 @@ func _initialize() -> void:
func _run() -> void:
var dashboard_service = root.get_node("DashboardService")
var mission_service = root.get_node("DailyMissionService")
var prior_data: Dictionary = dashboard_service.data
var prior_missions: Dictionary = mission_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}
]}
var dashboard = load("res://scripts/ui/dashboard_screen.gd").new()
dashboard.size = Vector2(1280, 900)
root.add_child(dashboard)
@@ -22,9 +29,13 @@ func _run() -> void:
_assert(dashboard.mastery_rows.size() == 14, "dashboard should render one mastery action row per system")
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")
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)
dashboard._update_responsive()
_assert(first_mastery_row.vertical, "narrow mastery rows should stack to avoid clipping")
_assert(first_mission_row.vertical, "narrow mission rows should stack to avoid clipping")
_assert(dashboard.rating_toggle.button_pressed, "rating should be the default trend mode")
_assert(dashboard.trend_chart.mode == "rating", "chart should initially render rating history")
dashboard._set_trend_mode("accuracy")
@@ -33,6 +44,7 @@ func _run() -> void:
dashboard.queue_free()
dashboard_service.data = prior_data
mission_service.state = prior_missions
await process_frame
quit(1 if failures > 0 else 0)