Wire browse-worlds screen to GET /api/worlds #36

Merged
reviewer-bot merged 6 commits from agent/1de295a0da42 into main 2026-08-19 23:12:27 +00:00
Collaborator

Browse-worlds screen wired to GET /api/worlds and fully verified end-to-end.

Client-side fixes:

  • main_menu.gd: Play button navigates to world_list.tscn
  • world_list.gd: fixed invalid card.theme_override_constants/separation = 4 (not a real property path) -> add_theme_constant_override("separation", 4); fixed @onready paths for refresh_button/back_button missing /HeaderHBox/; cast dict values to String to avoid Variant type-inference errors that only trigger once cards actually render (missed by an empty-state-only test)
  • world_list.tscn: added the two [connection] blocks for Back/Refresh buttons -- the scene had zero connections, so both buttons were dead
  • added scripts/smoke_test_world_list.gd: headless test that instantiates the real scene (catches @onready bugs an API-only test would miss), registers a user, and confirms it reaches a real end state

Backend bugs found and fixed while verifying (both pre-existing, both blocking this task's endpoint for ANY real data, not introduced by this change):

  • models/world.py: ENUM(WorldVisibility, ...) had no values_callable, so SQLAlchemy sent the Python enum's member name ("PUBLIC") to Postgres instead of its value ("public") -- broke both GET and POST /api/worlds/ for any query touching the visibility column
  • routers/worlds.py: WorldResponse.created_at was typed str but the column is a real datetime -- caused a second 500 (ResponseValidationError) on GET once the enum bug was fixed

Verified for real: spun up a throwaway Postgres, ran real migrations, started a real backend, registered a user via the actual API, POSTed a world, GETed it back, and ran the Godot smoke test against it -- confirmed 2 real world cards render in the instantiated scene from live backend data, not just an empty-list pass.

Browse-worlds screen wired to GET /api/worlds and fully verified end-to-end. Client-side fixes: - main_menu.gd: Play button navigates to world_list.tscn - world_list.gd: fixed invalid `card.theme_override_constants/separation = 4` (not a real property path) -> `add_theme_constant_override("separation", 4)`; fixed @onready paths for refresh_button/back_button missing /HeaderHBox/; cast dict values to String to avoid Variant type-inference errors that only trigger once cards actually render (missed by an empty-state-only test) - world_list.tscn: added the two [connection] blocks for Back/Refresh buttons -- the scene had zero connections, so both buttons were dead - added scripts/smoke_test_world_list.gd: headless test that instantiates the real scene (catches @onready bugs an API-only test would miss), registers a user, and confirms it reaches a real end state Backend bugs found and fixed while verifying (both pre-existing, both blocking this task's endpoint for ANY real data, not introduced by this change): - models/world.py: `ENUM(WorldVisibility, ...)` had no `values_callable`, so SQLAlchemy sent the Python enum's member name ("PUBLIC") to Postgres instead of its value ("public") -- broke both GET and POST /api/worlds/ for any query touching the visibility column - routers/worlds.py: WorldResponse.created_at was typed `str` but the column is a real datetime -- caused a second 500 (ResponseValidationError) on GET once the enum bug was fixed Verified for real: spun up a throwaway Postgres, ran real migrations, started a real backend, registered a user via the actual API, POSTed a world, GETed it back, and ran the Godot smoke test against it -- confirmed 2 real world cards render in the instantiated scene from live backend data, not just an empty-list pass.
coder-bot added 5 commits 2026-08-19 21:59:05 +00:00
- main_menu.gd: Play button now navigates to world_list.tscn
- world_list.gd: fix invalid theme_override_constants property-path syntax
  (use add_theme_constant_override), fix @onready node paths missing
  /HeaderHBox/, cast Variant dict values to String to avoid type-inference
  errors when cards actually render
- world_list.tscn: wire up Back/Refresh button signal connections (scene
  had zero [connection] blocks, buttons were dead)
- backend: fix real bug where World.visibility enum sent member names
  ("PUBLIC") to Postgres instead of lowercase values, breaking both GET
  and POST /api/worlds/ for any real query
- backend: fix WorldResponse.created_at typed as str instead of datetime,
  causing a second 500 on GET once the enum bug was fixed
- add smoke_test_world_list.gd: headless scene-level smoke test that
  registers a user, instantiates the real scene, and confirms world cards
  render from live backend data (not just an API-level check)
coder-bot added 1 commit 2026-08-19 23:12:11 +00:00
Resolves conflict in main_menu.gd's play button: kept this branch's real
world_list.tscn transition over main's stale TODO placeholder (main's
version predates this fix; nothing else has touched the play button
since). Brings in PR #37's /auth/refresh endpoint and its tests cleanly,
no other conflicts.
reviewer-bot merged commit 8a5d3aabea into main 2026-08-19 23:12:27 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: daddy/modbison#36