Merge pull request 'Main menu: hide the login/register form once authenticated, keep only the welcome message' (#44) from agent/470f875e0416 into main

This commit was merged in pull request #44.
This commit is contained in:
2026-08-20 17:08:45 +00:00
2 changed files with 25 additions and 7 deletions
+12 -4
View File
@@ -6,6 +6,10 @@ extends Control
## The Login and Register buttons on the AuthButtonsRow directly set the panel's
## mode, so the user can switch between Login and Register at any time while
## the panel is open.
##
## On successful auth the token is stored via ApiClient, AuthButtonsRow hides,
## the welcome label shows the username, and the Play button becomes enabled.
## The auth form fields are hidden, leaving only the welcome message visible.
# ─── UI references ────────────────────────────────────────────────────────────
@@ -158,12 +162,16 @@ func _on_auth_complete(result: Dictionary) -> void:
_is_authenticating = false
if result.ok:
# Success — show welcome, enable Play, hide the now-redundant
# Login/Register entry points (the auth panel itself stays open,
# showing the welcome message in place of the form).
# Success — hide the auth form fields, show only the welcome label.
_username_edit.visible = false
_password_edit.visible = false
_email_edit.visible = false
_dob_edit.visible = false
_auth_button.visible = false
_auth_mode_label.visible = false
_status_label.visible = false
_welcome_label.text = "Welcome, %s!" % _username_edit.text.strip_edges()
_welcome_label.visible = true
_status_label.visible = false
_play_button.disabled = false
_auth_buttons_row.visible = false
print("Auth successful. Token stored.")
+13 -3
View File
@@ -1,9 +1,8 @@
extends SceneTree
## Full click-through simulation of the real user flow: press Register,
## fill the form exactly as a human would, submit, confirm Play actually
## becomes clickable. This is the check that would have caught the
## original bug (no way to even open the form) and would catch a repeat
## of it.
## becomes clickable. Also verifies that after successful auth the auth
## form fields are hidden, leaving only the welcome message visible.
var passed := 0
var failed := 0
@@ -28,6 +27,7 @@ func _run() -> void:
var email_edit: LineEdit = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/EmailEdit")
var over_18_check: CheckBox = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/Over18Check")
var auth_button: Button = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthButton")
var auth_mode_label: Label = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/AuthModeLabel")
var welcome_label: Label = instance.get_node("CenterContainer/VBoxContainer/AuthPanel/MarginContainer/AuthVBox/WelcomeLabel")
var play_button: Button = instance.get_node("CenterContainer/VBoxContainer/PlayButton")
@@ -63,6 +63,16 @@ func _run() -> void:
_check("Welcome label visible", welcome_label.visible)
_check("Auth buttons row hid itself after success", not auth_buttons_row.visible)
# Verify the auth form fields are hidden after successful auth,
# leaving only the welcome message visible within the panel.
_check("Username edit hidden after auth", not username_edit.visible)
_check("Password edit hidden after auth", not password_edit.visible)
_check("Email edit hidden after auth", not email_edit.visible)
_check("DOB edit hidden after auth", not dob_edit.visible)
_check("Auth button hidden after auth", not auth_button.visible)
_check("Auth mode label hidden after auth", not auth_mode_label.visible)
_check("Welcome label contains username", welcome_label.text.begins_with("Welcome, mainmenu_e2e_"))
print("\n=== SMOKE RESULT: %d/%d passed ===" % [passed, passed + failed])
quit(0 if failed == 0 else 1)