Launch question bank directly from navigation

This commit is contained in:
hz
2026-07-18 14:57:33 -05:00
parent 33e461fd36
commit dca09d818f
6 changed files with 131 additions and 14 deletions
+4 -2
View File
@@ -7,8 +7,10 @@ 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("selection", "step3") == "home", "Step 3 mode selection should remain part of Home")
_assert(NavigationRoutes.key_for_screen("selection", "question_bank") == "question_bank", "direct question bank launch should activate Question Bank")
_assert(NavigationRoutes.key_for_screen("setup") == "question_bank", "block setup should activate Question Bank")
_assert(NavigationRoutes.key_for_screen("player") == "question_bank", "question player should map to Question Bank")
_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")
+7
View File
@@ -32,6 +32,10 @@ func _run() -> void:
_assert(dynamic_icon != null, "dynamic questions should expose its mode icon")
if dynamic_icon != null:
_assert(dynamic_icon.texture.resource_path == "res://assets/icons/lucide/activity.svg", "dynamic questions should use a web-safe vector icon")
selector._show_stage("question_bank")
await process_frame
_assert(selector.question_bank_launch_view.visible and not selector.mode_view.visible, "direct question bank navigation should show only the focused launch state")
_assert(selector.launch_retry_button != null and selector.launch_error_label != null, "question bank launch should retain retry and error controls")
var main_screen = load("res://scripts/ui/main.gd").new()
main_screen.size = host.size
@@ -43,6 +47,9 @@ func _run() -> void:
_assert(main_screen.theme_button.icon_alignment == HORIZONTAL_ALIGNMENT_CENTER, "the theme toggle icon should remain centered")
_assert(main_screen.header_panel.find_child("HeaderStats", true, false) == null, "the application header should not display rating or role labels")
_assert(not main_screen.account_chevron_button.visible, "nonessential account controls should collapse on phone-width headers")
var question_bank_nav := main_screen.sidebar.find_child("NavQuestionBank", true, false) as Button
_assert(question_bank_nav != null and question_bank_nav.text == "Question Bank", "the Practice navigation item should be replaced by Question Bank")
_assert(main_screen.sidebar.find_child("NavPractice", true, false) == null, "the sidebar should not retain a Practice navigation item")
host.queue_free()
await process_frame