fix(ui): address PR #115 review — 8 items

- Fix stale test path UILayer/HUD → InsertOverlay/HUD
- Fix D-record citation D-051 → D-049 in main.tscn
- Add null guards to hud.gd update methods (pre-_ready safety)
- Minimap: dirty-flag queue_redraw instead of per-frame
- Remove redundant _panel.size.x, debug print
- Fix DebugOverlay/GauntletHUD positioning comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 15:45:47 +02:00
co-authored by Claude Opus 4.6
parent 8c239d522c
commit 879ef6092f
4 changed files with 32 additions and 13 deletions
+6 -6
View File
@@ -6,14 +6,14 @@
## D-051 (diegetic insert display)
##
## Implementation: client/ui/time_display.gd — draw-based Control (removed from main scene #786;
## time display merged into HUD ImplantPanel at UILayer/HUD, see test_hud_* tests below).
## time display merged into HUD ImplantPanel at InsertOverlay/HUD, see test_hud_* tests below).
## Format function: Constants.format_game_time(time_of_day: int) -> String (extracted for
## testability from time_display.gd).
##
## Private state access: Tests read _time_str, _phase_str, _day_str, _has_data directly
## because time_display.gd is draw-based (no Label nodes to inspect). This is an accepted
## test pattern for draw-based UI — the private vars ARE the rendered output contract.
## Scene integration tests now check UILayer/HUD.get_time_text() instead.
## Scene integration tests now check InsertOverlay/HUD.get_time_text() instead.
class_name TestTimeDisplaySprint17
extends GdUnitTestSuite
@@ -273,16 +273,16 @@ func test_sim_bridge_day_phase_is_valid() -> void:
# -------------------------------------------------------------------------
# Scene: HUD panel at UILayer/HUD (time row merged in, TimeDisplay removed #786)
# Scene: HUD panel at InsertOverlay/HUD (time row merged in, TimeDisplay removed #786)
# -------------------------------------------------------------------------
func test_hud_panel_exists_in_ui_layer() -> void:
func test_hud_panel_exists_in_insert_overlay() -> void:
var scene := MAIN_SCENE
var instance = scene.instantiate()
auto_free(instance)
add_child(instance)
assert_that(instance.get_node_or_null("UILayer/HUD")).is_not_null()
assert_that(instance.get_node_or_null("InsertOverlay/HUD")).is_not_null()
func test_hud_time_row_updates_after_process() -> void:
var scene := MAIN_SCENE
@@ -296,7 +296,7 @@ func test_hud_time_row_updates_after_process() -> void:
})
instance._process(0.016)
var hud = instance.get_node_or_null("UILayer/HUD")
var hud = instance.get_node_or_null("InsertOverlay/HUD")
assert_that(hud).is_not_null()
assert_that(hud.get_time_text()).is_equal("12:00 · Afternoon · D1")