Redesign study navigation and light theme
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
extends SceneTree
|
||||
|
||||
const NavigationRoutes := preload("res://scripts/ui/navigation_routes.gd")
|
||||
|
||||
var failures := 0
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
_assert(NavigationRoutes.key_for_screen("selection", "exam") == "home", "exam selection should activate Home")
|
||||
_assert(NavigationRoutes.key_for_screen("selection", "step3") == "practice", "Step 3 modes should activate Practice")
|
||||
_assert(NavigationRoutes.key_for_screen("setup") == "practice", "block setup should activate Practice")
|
||||
_assert(NavigationRoutes.key_for_screen("simulation_results") == "exams", "simulation results should activate Exams")
|
||||
_assert(NavigationRoutes.key_for_screen("ccs_review") == "ccs", "CCS review should activate CCS Cases")
|
||||
_assert(NavigationRoutes.key_for_screen("profile") == "performance", "profile should activate Performance")
|
||||
_assert(NavigationRoutes.key_for_screen("map") == "study_plan", "study map should activate Study Plan")
|
||||
_assert(NavigationRoutes.key_for_screen("settings") == "settings", "settings should activate Settings")
|
||||
quit(1 if failures > 0 else 0)
|
||||
|
||||
|
||||
func _assert(condition: bool, message: String) -> void:
|
||||
if condition:
|
||||
return
|
||||
failures += 1
|
||||
push_error(message)
|
||||
@@ -0,0 +1 @@
|
||||
uid://d1shellnavigationtest
|
||||
@@ -9,6 +9,10 @@ func _initialize() -> void:
|
||||
_assert(history._action_for_state("block_active") == "resume", "active blocks should resume")
|
||||
_assert(history._action_for_state("between_blocks") == "resume", "between-block simulations should resume")
|
||||
_assert(history._action_for_state("abandoned") == "none", "abandoned simulations should be read-only")
|
||||
_assert(history.has_active_simulation({"hasActiveSimulation": true}, {}), "readiness should identify an active simulation")
|
||||
_assert(history.has_active_simulation({}, {"state": "block_active"}), "a loaded active block should be resumable")
|
||||
_assert(history.has_active_simulation({}, {"state": "between_blocks"}), "a loaded between-block simulation should be resumable")
|
||||
_assert(not history.has_active_simulation({}, {"state": "completed"}), "completed simulations should not appear active")
|
||||
quit(1 if failures > 0 else 0)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extends SceneTree
|
||||
|
||||
const Style := preload("res://scripts/ui/ui_style.gd")
|
||||
const Brand := preload("res://scripts/ui/medmind_style.gd")
|
||||
|
||||
var failures := 0
|
||||
|
||||
@@ -21,6 +22,12 @@ func _initialize() -> void:
|
||||
_assert(root.theme.get_color("default_color", "RichTextLabel").is_equal_approx(Style.TEXT), "rich text should use the light text color")
|
||||
var light_box := panel.get_theme_stylebox("panel") as StyleBoxFlat
|
||||
_assert(light_box.bg_color.is_equal_approx(Color("fffffe")), "custom panel surface should switch to light mode")
|
||||
_assert(Brand.background_color(false).is_equal_approx(Color("f1f5f9")), "MedMind light background should match the style guide")
|
||||
var light_card := Brand.content_card_box(false, true, Brand.ROYAL_BLUE)
|
||||
_assert(light_card.bg_color.is_equal_approx(Color.WHITE), "MedMind light cards should use white surfaces")
|
||||
_assert(light_card.border_color.is_equal_approx(Brand.ROYAL_BLUE), "active light cards should use the primary blue border")
|
||||
var light_field := Brand.field_box(false)
|
||||
_assert(light_field.border_color.is_equal_approx(Brand.LIGHT_BORDER), "light fields should use the semantic cool-gray border")
|
||||
|
||||
Style.set_dark_mode(true)
|
||||
Style.refresh_tree(root, false)
|
||||
|
||||
Reference in New Issue
Block a user