fix(client): clear the test debt — 2 production bugs, suite fully green (T-973 et al.)
Production fixes surfaced by honest test triage: - hud_groups.gd: _set_group_z crashed on freed HUD nodes — the typed loop variable errors before the is_instance_valid guard runs; prune first - fog_state.gd: _resize cleared _prev_visible (world-space keys survive resizes), so pre-resize tiles never decayed VISIBLE→EXPLORED (D-059) Test debt (T-928/929/934/935/936/937/938/939, T-864, T-973): lambda local-capture bugs rewritten with array captures (now assert exact emission counts), e2e suites updated to the current handshake + StartupMessage protocol and stream-aware reads against the live binary, fog perf test measures steady state, chime test pins the shipped 800ms catalog asset (D-067 amended separately), monologue gdUnit4 API typo, battery-warning tests follow the MetaScreen on_open lifecycle. 3 sprint2 proof tests revived (corner_reveal had passed from the wrong tile — NPC3 blocks (18,14); route corrected). Soft-skips converted to real do_skip reporting. T-1068: 7 orphan .gd.uid deleted, _format_pop/_format_radius deduped into atlas_format.gd (preload, no class_name — headless cache). Suite: 1264 cases/20 failures → 1268/0, independently re-verified (2536/2536, exit 0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +0,0 @@
|
||||
uid://dwdssbevd8gqq
|
||||
@@ -1 +0,0 @@
|
||||
uid://char_select_sr
|
||||
@@ -1 +0,0 @@
|
||||
uid://c8pvt3xr7kmd2
|
||||
@@ -0,0 +1,28 @@
|
||||
extends RefCounted
|
||||
## Shared formatting helpers for Atlas screens (T-1068).
|
||||
## Deduplicated from planet_screen.gd / system_screen.gd.
|
||||
## Consumed via explicit preload (no class_name — avoids the global class
|
||||
## cache dependency that breaks headless test runs on fresh checkouts):
|
||||
## const AtlasFormat := preload("res://ui/implant/apps/atlas/atlas_format.gd")
|
||||
|
||||
|
||||
## Thousands-separated integer, e.g. 1234567 -> "1,234,567".
|
||||
static func format_pop(pop: int) -> String:
|
||||
if pop <= 0:
|
||||
return "0"
|
||||
var s: String = str(pop)
|
||||
var result: String = ""
|
||||
var count: int = 0
|
||||
for i: int in range(s.length() - 1, -1, -1):
|
||||
if count > 0 and count % 3 == 0:
|
||||
result = "," + result
|
||||
result = s[i] + result
|
||||
count += 1
|
||||
return result
|
||||
|
||||
|
||||
## Body radius in km — thousands-separated above 10,000 km, plain below.
|
||||
static func format_radius(km: float) -> String:
|
||||
if km >= 10000.0:
|
||||
return "%s km" % format_pop(int(km))
|
||||
return "%.0f km" % km
|
||||
@@ -3,6 +3,8 @@ extends Control
|
||||
## Body entry screen for AtlasApp (#844, D-191).
|
||||
## Shows body detail panel. Heightmap viewer is in RegionalScreen.
|
||||
|
||||
const AtlasFormat := preload("res://ui/implant/apps/atlas/atlas_format.gd")
|
||||
|
||||
const PANEL_WIDTH: float = 320.0
|
||||
const PANEL_MARGIN: float = 16.0
|
||||
const COLOR_BG: Color = Color("#0d1117")
|
||||
@@ -85,7 +87,7 @@ func _rebuild_body_panel() -> void:
|
||||
|
||||
if inhabited:
|
||||
_body_panel.add_component(ImplantSeparator.new())
|
||||
_body_panel.add_component(ImplantDataRow.new("population " + _format_pop(pop)))
|
||||
_body_panel.add_component(ImplantDataRow.new("population " + AtlasFormat.format_pop(pop)))
|
||||
|
||||
_body_panel.add_component(ImplantSeparator.new())
|
||||
|
||||
@@ -95,22 +97,3 @@ func _rebuild_body_panel() -> void:
|
||||
_body_panel.add_component(ImplantTextBlock.new("atlas data pending (#839)"))
|
||||
|
||||
_body_panel.add_component(ImplantTextBlock.new("esc back to orbital view"))
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Helpers
|
||||
# =============================================================================
|
||||
|
||||
|
||||
func _format_pop(pop: int) -> String:
|
||||
if pop <= 0:
|
||||
return "0"
|
||||
var s: String = str(pop)
|
||||
var result: String = ""
|
||||
var count: int = 0
|
||||
for i: int in range(s.length() - 1, -1, -1):
|
||||
if count > 0 and count % 3 == 0:
|
||||
result = "," + result
|
||||
result = s[i] + result
|
||||
count += 1
|
||||
return result
|
||||
|
||||
@@ -6,6 +6,8 @@ extends Control
|
||||
|
||||
signal body_selected(body: Dictionary)
|
||||
|
||||
const AtlasFormat := preload("res://ui/implant/apps/atlas/atlas_format.gd")
|
||||
|
||||
const STAR_RADIUS: float = 140.0
|
||||
const STAR_X_OFFSET: float = 0.0
|
||||
const BODY_LEFT_MARGIN: float = 300.0
|
||||
@@ -667,11 +669,15 @@ func _rebuild_body_panel() -> void:
|
||||
_body_panel.add_component(ImplantDataRow.new(type_line))
|
||||
_body_panel.add_component(ImplantDataRow.new("atmosphere " + atmo))
|
||||
if radius_km > 0:
|
||||
_body_panel.add_component(ImplantDataRow.new("radius " + _format_radius(radius_km)))
|
||||
_body_panel.add_component(
|
||||
ImplantDataRow.new("radius " + AtlasFormat.format_radius(radius_km))
|
||||
)
|
||||
|
||||
if inhabited:
|
||||
_body_panel.add_component(ImplantSeparator.new())
|
||||
_body_panel.add_component(ImplantDataRow.new("population " + _format_pop(pop)))
|
||||
_body_panel.add_component(
|
||||
ImplantDataRow.new("population " + AtlasFormat.format_pop(pop))
|
||||
)
|
||||
|
||||
_body_panel.add_component(ImplantSeparator.new())
|
||||
var has_heightmap: bool = b.get("terrain_reference") != null
|
||||
@@ -680,23 +686,3 @@ func _rebuild_body_panel() -> void:
|
||||
_body_panel.add_component(ImplantTextBlock.new("esc close"))
|
||||
|
||||
_dirty = true
|
||||
|
||||
|
||||
static func _format_pop(pop: int) -> String:
|
||||
if pop <= 0:
|
||||
return "0"
|
||||
var s: String = str(pop)
|
||||
var result: String = ""
|
||||
var count: int = 0
|
||||
for i: int in range(s.length() - 1, -1, -1):
|
||||
if count > 0 and count % 3 == 0:
|
||||
result = "," + result
|
||||
result = s[i] + result
|
||||
count += 1
|
||||
return result
|
||||
|
||||
|
||||
static func _format_radius(km: float) -> String:
|
||||
if km >= 10000.0:
|
||||
return "%s km" % _format_pop(int(km))
|
||||
return "%.0f km" % km
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
uid://c6wtn7qk3mv2x
|
||||
@@ -1 +0,0 @@
|
||||
uid://8jhxbtbelw0y
|
||||
@@ -1 +0,0 @@
|
||||
uid://cpjq8yfsnpr5m
|
||||
Reference in New Issue
Block a user