feat: Pruefdialog nennt Regelwerk und Elementanzahl

- Katalog und Level-Regeln mit Saison und Quelle im Dialogkopf
- Zusammenfassung zaehlt die geprueften Elemente
- Tooltip am Pruefen-Button nennt die Saisons
- Whiteboard-Tests auf 237 Assertions erweitert (870 gesamt)
This commit is contained in:
torsten 2026-10-31 10:13:37 +01:00
parent 223a072f5d
commit b788c1be04
5 changed files with 96 additions and 14 deletions

View file

@ -197,6 +197,10 @@ func _ready() -> void:
push_warning(
"Level rules: %s" % ", ".join(_level_rules.get_errors())
)
validation_button.tooltip_text = (
"Prüft gegen Katalog %s und Level-Regeln %s"
% [_element_catalog.season, _level_rules.season]
)
_setup_tool_options()
_setup_file_menu()
_setup_playback_controls()
@ -451,17 +455,51 @@ func open_validation_dialog() -> void:
)
var lines := PackedStringArray()
if issues.is_empty():
var element_count := _count_elements()
if _element_catalog != null:
lines.append(
"[b]Keine Befunde.[/b] Alle Elemente passen zu Katalog und Level-Regeln."
"[b]Katalog %s:[/b] %s"
% [
_element_catalog.season,
_escape_bbcode(_element_catalog.source),
]
)
if _level_rules != null:
lines.append(
"[b]Level-Regeln %s:[/b] %s"
% [
_level_rules.season,
_escape_bbcode(_level_rules.source),
]
)
lines.append("")
if issues.is_empty():
if element_count == 0:
lines.append(
"[b]Keine Befunde.[/b] Es sind keine Elemente vorhanden."
)
elif element_count == 1:
lines.append(
"[b]Keine Befunde.[/b] Das Element passt zu Katalog und Level-Regeln."
)
else:
lines.append(
"[b]Keine Befunde.[/b] Alle %d Elemente passen zu Katalog und Level-Regeln."
% element_count
)
else:
lines.append(
"[b]%d Fehler, %d Warnungen[/b]" % [errors, warnings]
"[b]%d Fehler, %d Warnungen[/b] · %s geprüft"
% [errors, warnings, _element_count_label(element_count)]
)
lines.append("")
for issue: ValidationIssue in issues:
var color := "#ef4444" if issue.severity == ValidationIssue.Severity.ERROR else "#f59e0b"
var color := (
"#ef4444"
if issue.severity == ValidationIssue.Severity.ERROR
else "#f59e0b"
)
lines.append(
"[color=%s]●[/color] [b]%s[/b]%s: %s"
% [
@ -482,6 +520,23 @@ func open_validation_dialog() -> void:
validation_dialog.popup_centered(target)
func _count_elements() -> int:
if _routine == null:
return 0
var count := 0
for section: RoutineSection in _routine.sections:
if section == null:
continue
for segment: PathSegment in section.segments:
if segment != null and segment.is_element():
count += 1
return count
func _element_count_label(count: int) -> String:
return "1 Element" if count == 1 else "%d Elemente" % count
func _validation_location(issue: ValidationIssue) -> String:
var parts := PackedStringArray()
if not issue.section_id.is_empty():

View file

@ -1125,6 +1125,20 @@ func _run() -> void:
controller.validation_text.text.contains("nicht im Katalog"),
"validation dialog shows the catalog finding"
)
_check(
controller.validation_text.text.contains("Katalog 2025/26")
and controller.validation_text.text.contains("2707"),
"validation dialog names the catalog and its source"
)
_check(
controller.validation_text.text.contains("Level-Regeln 2025/26")
and controller.validation_text.text.contains("2701"),
"validation dialog names the level rules and their source"
)
_check(
controller.validation_text.text.contains("1 Element geprüft"),
"validation dialog reports how many elements were checked"
)
controller.validation_dialog.hide()
controller.new_routine()
@ -1139,6 +1153,13 @@ func _run() -> void:
clean_issues.is_empty(),
"a consistent routine has no validation findings"
)
controller.open_validation_dialog()
_check(
controller.validation_text.text.contains("Keine Befunde")
and controller.validation_text.text.contains("Das Element passt"),
"clean validation names the rule set and the checked element count"
)
controller.validation_dialog.hide()
scene.queue_free()
await process_frame