fix(client): address PR #86 review — archetype validation, teleport clear, ticker layout

- protocol.gd: replace capitalize() with explicit match for archetype
  string mapping, push_error on unknown input with Detective fallback
- main.gd: clear _known_triangle_ids in _teleport_transition() alongside
  _known_recognition_ids so chime re-fires after room change
- news_ticker.gd: defer get_minimum_size() via call_deferred to run
  after layout pass, fixing first-frame scroll distance
- 3 new tests: unknown archetype fallback, triangle dedup per-id,
  independent triangle ID firing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 16:28:12 +01:00
co-authored by Claude Opus 4.6
parent 349f02fbcb
commit e0eb3cd35e
4 changed files with 69 additions and 3 deletions
+9 -2
View File
@@ -36,12 +36,19 @@ func update_from_state() -> void:
if new_text != _text:
_text = new_text
_label.text = _text
# Reset scroll to start from the right edge on new headline.
_content_width = _label.get_minimum_size().x
# Reset scroll to start from right edge on new headline.
# Defer width read by one frame: get_minimum_size() returns stale
# data if called before the layout pass that follows text assignment.
_scroll_x = size.x
_content_width = 0.0 # will be updated after layout in _process
call_deferred("_update_content_width")
visible = true
func _update_content_width() -> void:
_content_width = _label.get_minimum_size().x
func _process(delta: float) -> void:
if not visible:
return