diff --git a/scripts/main_menu.gd b/scripts/main_menu.gd index 2cc632d..b2c5d0c 100644 --- a/scripts/main_menu.gd +++ b/scripts/main_menu.gd @@ -100,8 +100,20 @@ func _show_authenticated(username: String) -> void: _status_label.visible = false _welcome_label.text = "Welcome, %s!" % username _welcome_label.visible = true + # Hide the same full set of form fields _on_auth_complete() hides right + # after a fresh login/register -- this path (session restore on scene + # reload, e.g. after Play -> Back) used to only hide EmailEdit/ + # Over18Check, leaving UsernameEdit/PasswordEdit/AuthButton/ + # AuthModeLabel visible on top of the welcome message. Real bug: Play + # was enabled and the welcome label was correct, so it wasn't caught by + # checks for those alone -- the login fields being back on screen is + # what a user actually sees as "it's making me log in again." + _username_edit.visible = false + _password_edit.visible = false _email_edit.visible = false _over_18_check.visible = false + _auth_button.visible = false + _auth_mode_label.visible = false _play_button.disabled = false _auth_buttons_row.visible = false print("Restored authenticated session for: ", username) diff --git a/scripts/smoke_test_main_menu_back.gd b/scripts/smoke_test_main_menu_back.gd index 75e25b7..6313c8d 100644 --- a/scripts/smoke_test_main_menu_back.gd +++ b/scripts/smoke_test_main_menu_back.gd @@ -115,6 +115,10 @@ func _is_authenticated(menu: Control) -> bool: var welcome_label: Label = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel") var auth_buttons_row: HBoxContainer = menu.get_node("CenterContainer/VBoxContainer/AuthButtonsRow") var auth_panel: PanelContainer = menu.get_node("CenterContainer/VBoxContainer/AuthPanel") + var username_edit: LineEdit = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/UsernameEdit") + var password_edit: LineEdit = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/PasswordEdit") + var auth_button: Button = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton") + var auth_mode_label: Label = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthModeLabel") _check("Play enabled", not play_button.disabled) # WelcomeLabel lives inside AuthPanel, so `.visible` alone is a @@ -124,11 +128,24 @@ func _is_authenticated(menu: Control) -> bool: _check("Welcome label visible in tree", welcome_label.is_visible_in_tree()) _check("Auth buttons row hidden", not auth_buttons_row.visible) _check("Auth panel visible (it contains the welcome label)", auth_panel.visible) + # Real bug, 2026-08-20: the session-restore path (this one, after + # Play -> Back) hid EmailEdit/Over18Check but never the rest of the + # login form -- Play enabled + welcome label visible were both still + # true, so a check that stopped there passed while the user was + # looking at the login fields again on top of the welcome message. + _check("Username field hidden", not username_edit.visible) + _check("Password field hidden", not password_edit.visible) + _check("Auth button hidden", not auth_button.visible) + _check("Auth mode label hidden", not auth_mode_label.visible) return (not play_button.disabled) \ and welcome_label.is_visible_in_tree() \ and not auth_buttons_row.visible \ - and auth_panel.visible + and auth_panel.visible \ + and not username_edit.visible \ + and not password_edit.visible \ + and not auth_button.visible \ + and not auth_mode_label.visible func _wait_for_scene_change(previous_scene: Node) -> void: