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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6rUEynmv2QmweocAQYARN
This commit is contained in:
claude-checkpoint-tooling
2026-08-20 19:21:40 +00:00
parent 1c64dd4967
commit aeccc78143
2 changed files with 30 additions and 1 deletions
+12
View File
@@ -100,8 +100,20 @@ func _show_authenticated(username: String) -> void:
_status_label.visible = false _status_label.visible = false
_welcome_label.text = "Welcome, %s!" % username _welcome_label.text = "Welcome, %s!" % username
_welcome_label.visible = true _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 _email_edit.visible = false
_over_18_check.visible = false _over_18_check.visible = false
_auth_button.visible = false
_auth_mode_label.visible = false
_play_button.disabled = false _play_button.disabled = false
_auth_buttons_row.visible = false _auth_buttons_row.visible = false
print("Restored authenticated session for: ", username) print("Restored authenticated session for: ", username)
+18 -1
View File
@@ -115,6 +115,10 @@ func _is_authenticated(menu: Control) -> bool:
var welcome_label: Label = menu.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel") 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_buttons_row: HBoxContainer = menu.get_node("CenterContainer/VBoxContainer/AuthButtonsRow")
var auth_panel: PanelContainer = menu.get_node("CenterContainer/VBoxContainer/AuthPanel") 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) _check("Play enabled", not play_button.disabled)
# WelcomeLabel lives inside AuthPanel, so `.visible` alone is a # 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("Welcome label visible in tree", welcome_label.is_visible_in_tree())
_check("Auth buttons row hidden", not auth_buttons_row.visible) _check("Auth buttons row hidden", not auth_buttons_row.visible)
_check("Auth panel visible (it contains the welcome label)", auth_panel.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) \ return (not play_button.disabled) \
and welcome_label.is_visible_in_tree() \ and welcome_label.is_visible_in_tree() \
and not auth_buttons_row.visible \ 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: func _wait_for_scene_change(previous_scene: Node) -> void: