refactor: Hilfetext und Saisonvergleich aus dem Controller lösen

Erste Etappen der Controller-Zerlegung, Reihenfolge und Regeln in
`docs/refactor-whiteboard-controller.md`.

- `HelpContent` (src/whiteboard/view/help_content.gd): der Text des
  ?-Dialogs als reine Funktion, 137 Zeilen ohne Kopplung.
- `SeasonComparisonText` (src/whiteboard/view/season_comparison_text.gd):
  `build(routine, report)` liefert die BBCode-Zeilen des Saisonvergleichs;
  der Controller setzt sie nur noch ins Label.
- Eigener Test für den Vergleichstext (Gruppen, fehlendes Element, Summe,
  Befunde).

Controller: 9.092 -> 8.839 Zeilen. Kein Verhalten geändert, Suite grün.
Nächste Etappe laut Notiz: der Prüfdialog (ValidationReportView).
This commit is contained in:
torsten 2026-11-13 13:18:35 +01:00
parent 1b6e6d8ede
commit 1245f438f1
8 changed files with 383 additions and 314 deletions

View file

@ -19,6 +19,7 @@ func _init() -> void:
_test_broken_fixture_is_reported()
_test_season_pair_difference()
_test_upgrade_check()
_test_season_comparison_text()
_cleanup()
_finish()
@ -264,6 +265,32 @@ func _test_upgrade_check() -> void:
)
## Der Text des Saisonvergleichs ist reine Formatierung und damit testbar.
func _test_season_comparison_text() -> void:
var library := RulesLibrary.scan()
var current := library.get_package("2026/27")
var older := library.get_package("2025/26")
if current == null or older == null:
_check(false, "both seasons load for the comparison text")
return
var routine := _make_pair_routine()
routine.adult_category = "gold"
var report := SeasonUpgradeCheck.run(routine, current, older)
var text := "\n".join(SeasonComparisonText.build(routine, report))
_check(
text.contains("2026/27") and text.contains("2025/26"),
"the comparison text names both seasons"
)
_check(text.contains("[b]Elemente[/b]"), "the text has the element group")
_check(text.contains("ChSp"), "the text names the missing element")
_check(text.contains("[b]Summe[/b]"), "the text sums the base values")
_check(
text.contains("Befunde bei Prüfung gegen 2025/26"),
"the text adds the findings of the target season"
)
func _make_pair_routine() -> Routine:
var routine := Routine.new()
routine.routine_id = "season-pair"