diff --git a/client/scripts/quest_hud_controller.gd b/client/scripts/quest_hud_controller.gd index 88b2d1b..c243172 100644 --- a/client/scripts/quest_hud_controller.gd +++ b/client/scripts/quest_hud_controller.gd @@ -117,7 +117,7 @@ func _on_accept_failed(_quest_id: String, reason: String) -> void: func _on_definitions_ready(_quests: Array) -> void: _defs_error = "" - if _progress_error.is_empty() and not _last_snapshot.is_empty(): + if not _last_snapshot.is_empty(): _render_progress_label() diff --git a/client/test/quest_hud_controller_test.gd b/client/test/quest_hud_controller_test.gd index f443f3b..497e616 100644 --- a/client/test/quest_hud_controller_test.gd +++ b/client/test/quest_hud_controller_test.gd @@ -381,3 +381,36 @@ func test_shift_q_shows_definitions_error_when_defs_failed() -> void: controller.call("_request_eligible_accept") # Assert assert_str(accept_label.text).contains("definitions error") + + +func _gather_defs_json() -> String: + return ( + '{"schemaVersion":1,"quests":[' + + '{"id":"prototype_quest_gather_intro","displayName":"Intro: Salvage Run",' + + '"prerequisiteQuestIds":[],"steps":[]}]}' + ) + + +func test_definitions_ready_repaints_with_display_names_when_progress_error() -> void: + # Arrange + var defs_transport := MockHttpTransport.new() + defs_transport.body_json = _gather_defs_json() + var defs_client: Node = _make_defs_client(defs_transport) + var progress_client: Node = _make_progress_client(NoopHttpTransport.new()) + var controller: Node = QuestHudController.new() + var progress_label := Label.new() + auto_free(controller) + auto_free(progress_label) + add_child(controller) + await get_tree().process_frame + defs_client.call("request_sync_from_server") + controller.set("_progress_client", progress_client) + controller.set("_defs_client", defs_client) + controller.set("_progress_label", progress_label) + controller.set("_last_snapshot", _not_started_snapshot()) + controller.set("_progress_error", "HTTP 503") + # Act + controller.call("_on_definitions_ready", []) + # Assert + assert_str(progress_label.text).contains("Intro: Salvage Run") + assert_str(progress_label.text).not_contains("prototype_quest_gather_intro") diff --git a/docs/reviews/2026-06-07-NEO-122-follow-up.md b/docs/reviews/2026-06-07-NEO-122-follow-up.md index 04336e2..0c11e04 100644 --- a/docs/reviews/2026-06-07-NEO-122-follow-up.md +++ b/docs/reviews/2026-06-07-NEO-122-follow-up.md @@ -61,6 +61,8 @@ Seven commits landed after the first review: code-review follow-up (quest-defini 7. ~~**Shift+Q hides definitions failure** — Block eligible accept when `_defs_error` is set and catalog is empty. **Done.** +8. ~~**Definitions ready skips HUD repaint** — `_on_definitions_ready` repaints when snapshot exists even if `_progress_error` is set so display names replace raw ids. **Done.** + ## Verification ```bash @@ -70,7 +72,7 @@ godot --headless --path . -s addons/gdUnit4/bin/GdUnitCmdTool.gd \ -a res://test ``` -Full suite: **254** cases, **0** orphans (GdUnit exit **0**). +Full suite: **255** cases, **0** orphans (GdUnit exit **0**). ```bash # Focused NEO-122 / layout subset