Add session expiry renewal flow

This commit is contained in:
hz
2026-07-18 15:53:11 -05:00
parent 8c349314ad
commit a232e18c46
14 changed files with 575 additions and 21 deletions
+14
View File
@@ -53,6 +53,20 @@ func _run() -> void:
if menu_button.text == "Profile":
pause_menu_has_profile = true
_assert(not pause_menu_has_profile, "the paused-run menu should not duplicate profile navigation")
_assert(main_screen.session_expiry_dialog != null, "the application shell should construct a global session-expiry prompt")
main_screen.session_expiry_dialog._show_warning(120)
_assert(main_screen.session_expiry_dialog.visible, "the session-expiry prompt should cover every authenticated screen")
_assert(main_screen.session_expiry_dialog.message_label.text.contains("02:00"), "the session-expiry prompt should display a live countdown")
main_screen.session_expiry_dialog._refresh_started()
_assert(main_screen.session_expiry_dialog.stay_button.disabled, "the renewal action should lock while a refresh request is active")
main_screen.session_expiry_dialog._refresh_failed("Connection interrupted.", false)
_assert(not main_screen.session_expiry_dialog.stay_button.disabled, "a transient renewal failure should permit retry before expiry")
var cancel_event := InputEventAction.new()
cancel_event.action = "ui_cancel"
cancel_event.pressed = true
main_screen.session_expiry_dialog._unhandled_input(cancel_event)
_assert(main_screen.session_expiry_dialog.visible, "the session-expiry prompt should not be dismissible with Escape")
main_screen.session_expiry_dialog.dismiss_for_logout()
_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")