From aeccc781431246241bd3838cb9118829af10c4f4 Mon Sep 17 00:00:00 2001 From: claude-checkpoint-tooling Date: Thu, 20 Aug 2026 19:21:40 +0000 Subject: [PATCH] Fix login form fields reappearing after Play -> Back (real playtest bug) _show_authenticated() (the session-restore path, used when returning to main_menu.tscn -- e.g. after clicking Back from world_list) only hid EmailEdit/Over18Check, unlike _on_auth_complete() (the fresh-login path) which hides the full form: UsernameEdit, PasswordEdit, EmailEdit, Over18Check, AuthButton, AuthModeLabel. Play was correctly enabled and the welcome message was correctly visible, so a check that stopped at those two passed clean -- but the actual login fields were still on screen, which is what a real user sees as "it's making me log in again." Confirmed via live PC1 playtest today. Reported by: real playtest, 2026-08-20 (yesterday's automated regression test for this exact Play -> Back flow only asserted Play/welcome/auth buttons row -- strengthened smoke_test_main_menu_back.gd to also check the individual form fields, and confirmed it fails exactly this way with the bug reintroduced before restoring the fix). Verified against a live backend: 61/61 pytest (unaffected), 8/8 Godot smoke tests (including 20/20 on the strengthened back-nav test). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01M6rUEynmv2QmweocAQYARN --- scripts/main_menu.gd | 12 ++++++++++++ scripts/smoke_test_main_menu_back.gd | 19 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) 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: