Reach Settings/Profile from the pause menu, with a way back
The pause menu (Escape during a question/CCS/flashcards run) only had Resume/UI Sounds/Exit Run/Log Out. Settings already has an equivalent "Interface sounds" toggle, so drop the duplicate from the pause menu. More importantly, "player" and "ccs_player" hide the entire app shell (header + sidebar), so there was no way to reach Settings or Profile at all mid-session - add Profile/Settings buttons to the pause menu to close that gap. Navigating there follows the existing return_screen payload convention (already used by simulation_history/results/review) rather than inventing new navigation infrastructure: _navigate_from_pause() remembers current_screen_name and passes it through show_screen's payload. Both screens show a "Back to session" button when that's set, and hide it otherwise (including on ordinary non-paused visits). show_screen() unconditionally resumes the question timer via _close_app_menu() as a side effect of any navigation, so _navigate_from_pause() re-pauses it immediately when leaving "player" - the timer then resumes for real, for free, when the user actually returns via show_screen(return_screen). progress_profile.gd rebuilds its whole child tree on every theme toggle (_rebuild -> _build), which would otherwise wipe the button's visibility - added _refresh_back_to_session_visibility(), called both after _build() and from on_show(), so it survives a theme change while paused. Flipped tests/web_responsive_test.gd's assertion, which previously required the pause menu NOT to have a Profile button. Verified end-to-end headlessly: opening the pause menu from a live "player" session, navigating to Settings and Profile, confirming current_question_pause_started_at is correctly paused while away and resumed on return, confirming the back-to-session button appears only when reached via pause (not on ordinary nav), and confirming it survives a dark/light theme toggle on the Profile screen.
This commit is contained in:
@@ -50,10 +50,13 @@ func _run() -> void:
|
||||
_assert(main_screen.account_chevron_button.get_index() == main_screen.account_button.get_index() + 1, "the account avatar and chevron should remain adjacent")
|
||||
_assert(main_screen.header_panel.find_child("HeaderStats", true, false) == null, "the application header should not display rating or role labels")
|
||||
var pause_menu_has_profile := false
|
||||
var pause_menu_has_settings := false
|
||||
for menu_button in main_screen.app_menu.find_children("*", "Button", true, false):
|
||||
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")
|
||||
if menu_button.text == "Settings":
|
||||
pause_menu_has_settings = true
|
||||
_assert(pause_menu_has_profile and pause_menu_has_settings, "the paused-run menu should offer Profile and Settings 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")
|
||||
|
||||
Reference in New Issue
Block a user