feat: Kuerzelauswahl im Element-Inspector

- Katalog-Dropdown mit Anzeigenamen je Elementtyp
- Freitext-Fallback fuer Kombinationen und Varianten
- Suffix-Codes und feste Level werden beim Oeffnen uebernommen
- Typwechsel erhaelt nicht passende Codes als Freitext
- Whiteboard-Tests auf 241 Assertions erweitert (900 gesamt)
- Doku, Findings und Roadmap aktualisiert
This commit is contained in:
torsten 2026-10-31 10:30:47 +01:00
parent 57c0b4cb8e
commit 9cb880fca0
9 changed files with 310 additions and 25 deletions

View file

@ -3,8 +3,8 @@
Stand: 2026-10-31
Grundlage: `rinkplanner/rinkplanner_definition_agent_guidelines.md`
Übergeordnete Reihenfolge: `docs/roadmap.md`
Letzte Session: `docs/findings-2026-10-31-validierung.md`
(Session davor: `docs/findings-2026-10-31-isu-levels.md`)
Letzte Session: `docs/findings-2026-10-31-kuerzelauswahl.md`
(Session davor: `docs/findings-2026-10-31-validierung.md`)
## 1. Leitentscheidung
@ -185,7 +185,9 @@ Begrenzung auf zwei Features pro Fuß.
Bereiche entstehen, indem ein gezeichnetes Segment über den Inspector
getaggt wird. Punktmarker haben eine **Standzeit** (`element_duration_seconds`)
mit Typ-Defaults (Sprung 0,7 s, Pirouette 8 s, Sequenz 0 s), die im
Inspector übersteuert wird und in die Timeline eingeht. Der Inspector zeigt
Inspector übersteuert wird und in die Timeline eingeht. Das Kürzel wird
über eine Auswahlbox aus dem Katalog gewählt (mit Freitext-Fallback für
Kombinationen und Varianten). Der Inspector zeigt
außerdem den **Base Value** des eingegebenen Kürzels und Levels aus dem
Saisonkatalog; unbekannte Kürzel werden als „nicht im Katalog“ markiert.
Der Button **Features (n)** öffnet die Checkbox-Liste der Level-Features
@ -362,11 +364,11 @@ Aktueller Stand:
Prüfstatistik je Kategorie.
- **Canvas:** 90 Assertions für Meter→Pixel-Mapping, Fit/Zoom/Pan,
Rink-Kontur und die reine Bogen-Geometrie.
- **Whiteboard:** 238 Assertions für Controller-Verdrahtung, Segmenterzeugung,
- **Whiteboard:** 241 Assertions für Controller-Verdrahtung, Segmenterzeugung,
Linien-/Bogenpfade, Klemmen an der Bande, Auswahl, Griff- und
Richtungs-/Kanten-Bearbeitung, Segmentlöschung, Element-Marker (Setzen,
Typwechsel, Inspector inkl. Standzeit, Base-Value- und Feature-Hinweis,
Feature-Menü, Verschieben, Löschen), Section-Verwaltung,
Typwechsel, Inspector inkl. Kürzelauswahl, Standzeit, Base-Value- und
Feature-Hinweis, Feature-Menü, Verschieben, Löschen), Section-Verwaltung,
Ghosting-Zustand, Segment-Labels inklusive Dialog und Sichtbarkeits-Schalter,
Speichern/Laden, Schema-Prüfung, Dirty-State, Prüfdialog,
Navigationsmodus und den Maus-Drag-Pfad.

View file

@ -0,0 +1,70 @@
# Findings – Session: Kürzelauswahl im Element-Inspector (2026-10-31)
Ergänzung zu `docs/findings-2026-10-31-validierung.md`.
Das Kürzel war bisher ein reines Freitextfeld. Für Standardelemente gibt es
jetzt eine Auswahlbox aus dem Saisonkatalog; Freitext bleibt als bewusster
Fallback für Kombinationen und Varianten.
## Ergebnis
| Ziel | Ergebnis |
| :--- | :--- |
| Kürzelwahl | `OptionButton` mit Familien des gewählten Elementtyps |
| Anzeige | Code plus Name, z. B. `CCoSp — Change foot combination spin` |
| Fallback | „Freitext / Kombination …“ blendet das bisherige Textfeld ein |
| Leerzustand | „— Kürzel wählen —“ |
| Level | Suffix und feste Level werden beim Öffnen übernommen |
| Tests | 900 Assertions gesamt, `./tools/test.sh` grün |
## Entscheidungen
- **Auswahl statt reinem Freitext.** Tippfehler wie `ChStSq` entstehen bei
der Auswahl nicht mehr; der Katalog liefert die zulässigen Familien bereits
typgefiltert.
- **Freitext bleibt.** Sprungkombinationen (`3Lz+2T`), Folgen, Varianten
(`3Lzq`, `CCoSpV`) und künftige Elemente sind noch nicht strukturiert
modelliert. Ein striktes Dropdown würde sie blockieren.
- **Freitext ist ein expliziter Modus.** Das Textfeld ist standardmäßig
ausgeblendet und erscheint erst nach Auswahl von
„Freitext / Kombination …“. Der Platzhalter nennt Beispiele.
- **Bestehende Codes werden tolerant gelesen.** Beim Öffnen wird ein
Katalogcode ausgewählt; ein gespeicherter Suffix-Code wie `CCoSp4` wählt
`CCoSp` und setzt Level 4. Unbekannte Codes landen im Freitextmodus, ohne
verloren zu gehen.
- **Typwechsel erhält Eingaben.** Wechselt der Elementtyp, wird die Liste neu
aufgebaut. Ein Code, der im neuen Typ nicht vorkommt, bleibt als Freitext
erhalten; die Validierung meldet den Typ-Mismatch.
- **Feste Level werden gesetzt.** `ChSq` wählt beim Öffnen bzw. bei der
Auswahl automatisch Level 1.
## Bedienung
- Kürzel-Feld im Element-Dialog ist jetzt eine Auswahlbox:
- „— Kürzel wählen —“
- alle Familien des Typs mit Anzeigename
- „Freitext / Kombination …“
- Auswahl einer Familie blendet das Textfeld aus; Auswahl von „Freitext“
zeigt und fokussiert es.
- Base-Value- und Feature-Hinweis reagieren auf die Auswahl wie bisher.
- Beim Übernehmen wird der Code aus der Auswahl bzw. aus dem Freitextfeld
gelesen; die bestehende Suffix-Normalisierung bleibt aktiv.
## Tests
Erweitert: `tests/run_whiteboard_tests.gd` (238 → 241 Assertions)
- Dropdown ist mit der Familie vorbefüllt, Freitextfeld verborgen
- Katalogauswahl setzt Code und Base-Value-Hinweis
- „Freitext“ zeigt das Textfeld
- Suffix-Code und unbekannter Code funktionieren weiterhin über den Fallback
Visuell geprüft über `tests/manual/capture_elements.gd ... features` bei
1400 × 876.
## Offene Punkte
1. **Autovervollständigung:** `ElementCatalog.suggest()` ist weiterhin nicht
an ein Suchfeld angebunden; die Auswahlbox listet alle Familien.
2. **Kombinationen:** `3Lz+2T` bleibt Freitext und wird vom Validator als
unbekanntes Kürzel gemeldet, bis Kombinationen modelliert sind.
3. **Varianten:** `q`, `<`, `e`, `!`, `V` sind nicht Teil des Katalogs.

View file

@ -14,7 +14,7 @@ strukturierte Prüfung der Elementdaten gegen das geladene Regelwerk.
| Oberfläche | Button „Prüfen“ in der Statusleiste, Dialog mit Prüfliste und Befunden |
| Prüfstatistik | Je Kategorie geprüft/bestanden plus Element- und Abschnittszahl |
| Verhalten | Prüfung ist nicht blockierend; Speichern und Export bleiben möglich |
| Tests | 897 Assertions gesamt, `./tools/test.sh` grün (neu: 54 Validierung) |
| Tests | 900 Assertions gesamt, `./tools/test.sh` grün (neu: 54 Validierung) |
## Entscheidungen
@ -98,7 +98,7 @@ Neu: `tests/run_validation_tests.gd` (54 Assertions)
- fehlendes Regelwerk
- Prüfstatistik je Kategorie (geprüft/bestanden/Befunde, übersprungene Checks)
Erweitert: `tests/run_whiteboard_tests.gd` (228 → 238 Assertions) prüft
Erweitert: `tests/run_whiteboard_tests.gd` (228 → 241 Assertions) prüft
`validate_routine()`, den Prüfdialog mit Prüfliste, Umfang, Befunden und
Begründungen für nicht anwendbare Prüfungen sowie eine saubere Kür.

View file

@ -145,7 +145,14 @@ pro Fuß“ sind noch nicht umgesetzt.
## Bedienung
Der Element-Inspector zeigt unter der Level-Auswahl `Base Value: 3,50`.
Der Element-Inspector bietet für das Kürzel eine Auswahlbox mit den Familien
des gewählten Elementtyps, z. B. `CCoSp — Change foot combination spin`. Für
Kombinationen und Varianten, die der Katalog nicht strukturiert abbildet
(`3Lz+2T`, `3Lzq`, `CCoSpV`), gibt es den Eintrag **„Freitext / Kombination …“**;
er blendet das bisherige Textfeld ein. Beim Übernehmen werden Level-Suffixe
weiterhin ins Level-Feld normalisiert.
Der Inspector zeigt unter der Level-Auswahl `Base Value: 3,50`.
Unbekannte Kürzel erscheinen als „Kürzel nicht im Katalog 2025/26“. Der
Hinweis aktualisiert sich bei Änderungen an Typ, Kürzel und Level; der Tooltip
nennt Saison und Quelle.

View file

@ -124,7 +124,8 @@ Voraussetzung für Phase 1.
- [x] Programmweite Einmal-Features (`once_per_program`) als Warnung
- [ ] Max. zwei Features pro Fuß und Feature-Positionsregeln
- [ ] Kombinations-, Wiederholungs- und Programmtyp-Regeln
- [ ] Optional: Kürzelvorschläge im Inspector aus `suggest()`
- [x] Kürzelauswahl im Inspector (Katalog-Dropdown mit Freitext-Fallback)
- [ ] Optional: Suchfeld/Autovervollständigung aus `suggest()`
- [ ] Optional: GOE-Tabellen sowie `V`-/Unterrotationsvarianten
### Danach: Weitere fachliche Erweiterungen

View file

@ -602,12 +602,19 @@ theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
theme_override_font_sizes/font_size = 15
text = "Kürzel"
[node name="ElementCodeEdit" type="LineEdit" parent="ElementDialog/ElementBox"]
[node name="ElementCodeOption" type="OptionButton" parent="ElementDialog/ElementBox"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 56)
layout_mode = 2
theme_override_font_sizes/font_size = 17
placeholder_text = "z. B. 3Lz, CCoSp4, ChStSq"
[node name="ElementCodeEdit" type="LineEdit" parent="ElementDialog/ElementBox"]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(0, 56)
layout_mode = 2
theme_override_font_sizes/font_size = 17
placeholder_text = "z. B. 3Lz+2T, 3Lzq, CCoSpV"
max_length = 24
caret_blink = true

View file

@ -53,6 +53,8 @@ const ELEMENT_CATALOG_SCRIPT := preload("res://src/core/rules/element_catalog.gd
const ELEMENT_LEVEL_RULES_SCRIPT := preload("res://src/core/rules/element_level_rules.gd")
const ROUTINE_VALIDATOR_SCRIPT := preload("res://src/core/rules/routine_validator.gd")
const FEATURE_MENU_RESET_ID := 1000000
const CODE_OPTION_PLACEHOLDER_ID := 0
const CODE_OPTION_FREE_ID := 1000000
const EXPORT_IMAGE_SIZE := Vector2i(2560, 1600)
const AUTOSAVE_PATH := "user://autosave.tres"
const SYNC_SETTINGS_PATH := "user://sync.cfg"
@ -111,6 +113,7 @@ const COMPACT_LAYOUT_WIDTH := 1280.0
@onready var element_type_option: OptionButton = %ElementTypeOption
@onready var element_dialog: ConfirmationDialog = %ElementDialog
@onready var element_dialog_type_option: OptionButton = %ElementDialogTypeOption
@onready var element_code_option: OptionButton = %ElementCodeOption
@onready var element_code_edit: LineEdit = %ElementCodeEdit
@onready var element_level_option: OptionButton = %ElementLevelOption
@onready var element_value_label: Label = %ElementValueLabel
@ -786,7 +789,7 @@ func update_element_value_hint() -> void:
var level := 0
if element_level_option.selected >= 0:
level = element_level_option.get_item_id(element_level_option.selected)
var code := element_code_edit.text.strip_edges()
var code := _dialog_element_code()
var source := "%s · %s" % [_element_catalog.season, _element_catalog.source]
element_value_label.tooltip_text = source
@ -810,6 +813,147 @@ func get_selected_element_caption() -> String:
return segment.get_element_caption() if segment != null else ""
## Returns the code currently entered in the dialog, either from the catalog
## selection or from the free-text fallback.
func _dialog_element_code() -> String:
if element_code_edit.visible:
return element_code_edit.text.strip_edges()
var index := element_code_option.selected
if index < 0:
return ""
var item_id := element_code_option.get_item_id(index)
if (
item_id == CODE_OPTION_PLACEHOLDER_ID
or item_id == CODE_OPTION_FREE_ID
):
return ""
var metadata: Variant = element_code_option.get_item_metadata(index)
return str(metadata).strip_edges() if metadata != null else ""
## Fills the catalog dropdown for one element type. The free-text entry stays
## available for combinations and variants that the catalog does not model.
func _populate_code_options(type: PathSegment.ElementType) -> void:
element_code_option.clear()
element_code_option.add_item(
"— Kürzel wählen —",
CODE_OPTION_PLACEHOLDER_ID
)
if _element_catalog != null and type != PathSegment.ElementType.NONE:
for family: String in _element_catalog.get_codes(type):
var definition := _element_catalog.find(family)
var label := family
if definition != null and not definition.display_name.is_empty():
label = "%s — %s" % [family, definition.display_name]
var item_id := element_code_option.item_count
element_code_option.add_item(label, item_id)
element_code_option.set_item_metadata(item_id, family)
element_code_option.add_separator()
element_code_option.add_item(
"Freitext / Kombination …",
CODE_OPTION_FREE_ID
)
## Selects [param code] in the dropdown. Codes outside the catalog switch to
## free text; canonical suffixes and fixed levels update the level dropdown.
func _select_code_in_option(
type: PathSegment.ElementType,
code: String
) -> void:
var cleaned := code.strip_edges()
if cleaned.is_empty():
var placeholder := element_code_option.get_item_index(
CODE_OPTION_PLACEHOLDER_ID
)
if placeholder >= 0:
element_code_option.select(placeholder)
element_code_edit.text = ""
_set_code_free_text(false)
return
var definition: ElementDefinition = null
if _element_catalog != null:
definition = _element_catalog.find(cleaned)
if definition != null and definition.element_type == type:
var family := definition.code
var index := _find_code_option_index(family)
if index >= 0:
element_code_option.select(index)
element_code_edit.text = family
_set_code_free_text(false)
var suffix := _element_catalog.get_level_suffix(cleaned)
if suffix >= 0:
_select_level_option(suffix)
elif _level_rules != null:
var fixed := _level_rules.get_fixed_level(type, family)
if fixed >= 0:
_select_level_option(fixed)
return
var free_index := element_code_option.get_item_index(CODE_OPTION_FREE_ID)
if free_index >= 0:
element_code_option.select(free_index)
element_code_edit.text = cleaned
_set_code_free_text(true)
func _find_code_option_index(family: String) -> int:
var needle := family.strip_edges().to_lower()
for index: int in range(element_code_option.item_count):
var metadata: Variant = element_code_option.get_item_metadata(index)
if metadata == null:
continue
if str(metadata).strip_edges().to_lower() == needle:
return index
return -1
func _set_code_free_text(enabled: bool) -> void:
element_code_edit.visible = enabled
func _select_level_option(level: int) -> void:
var index := element_level_option.get_item_index(level)
if index >= 0:
element_level_option.select(index)
func _on_element_code_option_selected(index: int) -> void:
var item_id := element_code_option.get_item_id(index)
if item_id == CODE_OPTION_FREE_ID:
_set_code_free_text(true)
element_code_edit.grab_focus()
element_code_edit.select_all()
elif item_id == CODE_OPTION_PLACEHOLDER_ID:
_set_code_free_text(false)
element_code_edit.text = ""
else:
_set_code_free_text(false)
var metadata: Variant = element_code_option.get_item_metadata(index)
var family := str(metadata).strip_edges() if metadata != null else ""
element_code_edit.text = family
var type: PathSegment.ElementType = element_dialog_type_option.get_item_id(
element_dialog_type_option.selected
)
if _level_rules != null:
var fixed := _level_rules.get_fixed_level(type, family)
if fixed >= 0:
_select_level_option(fixed)
update_element_value_hint()
func _on_element_dialog_type_selected(index: int) -> void:
var type: PathSegment.ElementType = element_dialog_type_option.get_item_id(index)
var current := _dialog_element_code()
_populate_code_options(type)
_select_code_in_option(
type,
"" if type == PathSegment.ElementType.NONE else current
)
update_element_value_hint()
## Splits a canonical level suffix ("CCoSp4", "StSqB") into the level field so
## segments keep the family code and the level separate. Unknown codes and
## mismatched types are left untouched.
@ -974,9 +1118,10 @@ func _setup_element_controls() -> void:
element_level_option.add_item("Level %d" % level, level)
element_code_edit.text_changed.connect(_on_element_code_text_changed)
element_code_option.item_selected.connect(_on_element_code_option_selected)
element_level_option.item_selected.connect(_on_element_value_option_selected)
element_dialog_type_option.item_selected.connect(
_on_element_value_option_selected
_on_element_dialog_type_selected
)
element_features_button.pressed.connect(_open_feature_menu)
element_feature_menu.hide_on_item_selection = false
@ -1016,11 +1161,12 @@ func _open_element_dialog() -> void:
if type_index < 0:
type_index = 0
element_dialog_type_option.select(type_index)
element_code_edit.text = segment.element_code
_populate_code_options(segment.element_type)
var level_index := element_level_option.get_item_index(segment.element_level)
if level_index < 0:
level_index = 0
element_level_option.select(level_index)
_select_code_in_option(segment.element_type, segment.element_code)
var is_marker := segment.is_element_marker()
element_duration_spin.set_value_no_signal(segment.element_duration_seconds)
@ -1032,8 +1178,11 @@ func _open_element_dialog() -> void:
)
element_dialog.popup_centered(Vector2i(520, 460))
element_code_edit.grab_focus()
element_code_edit.select_all()
if element_code_edit.visible:
element_code_edit.grab_focus()
element_code_edit.select_all()
else:
element_code_option.grab_focus()
update_element_value_hint()
update_element_feature_hint()
@ -1043,7 +1192,12 @@ func _on_element_confirmed() -> void:
element_dialog_type_option.selected
)
var level: int = element_level_option.get_item_id(element_level_option.selected)
set_selected_element(type, element_code_edit.text, level, element_duration_spin.value)
set_selected_element(
type,
_dialog_element_code(),
level,
element_duration_spin.value
)
func add_section() -> RoutineSection:

View file

@ -57,7 +57,7 @@ func _capture() -> void:
"CCoSp4",
3
)
controller.add_element_marker(
var free_marker := controller.add_element_marker(
Vector2(12.0, -8.0),
PathSegment.ElementType.SEQUENCE,
"ChStSq",
@ -91,6 +91,9 @@ func _capture() -> void:
controller.element_button.pressed.emit()
elif args.size() > 3 and args[3] == "validate":
controller.open_validation_dialog()
elif args.size() > 3 and args[3] == "free":
controller.select_segment(free_marker.segment_id)
controller.element_button.pressed.emit()
elif args.size() > 3 and args[3] == "spin":
var elapsed := 0.0
for segment: PathSegment in controller.get_active_section().segments:

View file

@ -757,6 +757,18 @@ func _run() -> void:
controller.element_code_edit.text == "CCoSp",
"element dialog is prefilled with the normalized code"
)
var selected_code_index := controller.element_code_option.selected
_check(
selected_code_index >= 0
and str(
controller.element_code_option.get_item_metadata(selected_code_index)
) == "CCoSp",
"the code dropdown is prefilled with the catalog family"
)
_check(
not controller.element_code_edit.visible,
"a catalog code hides the free-text field"
)
_check(
controller.element_level_option.get_item_id(
controller.element_level_option.selected
@ -770,7 +782,7 @@ func _run() -> void:
"element dialog shows the base value of the current code and level"
)
controller.element_code_edit.text = "CCoSp"
_select_dialog_code(controller, "CCoSp")
controller.element_level_option.select(
controller.element_level_option.get_item_index(2)
)
@ -780,15 +792,17 @@ func _run() -> void:
"base value follows a family code and level 2"
)
controller.element_code_edit.text = "CCoSp4"
controller.update_element_value_hint()
_set_dialog_free_text(controller, "CCoSp4")
_check(
controller.element_code_edit.visible,
"free-text mode shows the text field"
)
_check(
controller.element_value_label.text.contains("3,50"),
"a canonical suffix wins over the level control"
)
controller.element_code_edit.text = "3X"
controller.update_element_value_hint()
_set_dialog_free_text(controller, "3X")
_check(
controller.element_value_label.text.contains("nicht im Katalog"),
"unknown codes are marked as not in the catalog"
@ -875,7 +889,7 @@ func _run() -> void:
"clearing removes all features"
)
controller.element_code_edit.text = "CCoSp"
_select_dialog_code(controller, "CCoSp")
controller.element_level_option.select(
controller.element_level_option.get_item_index(2)
)
@ -1180,6 +1194,33 @@ func _check(condition: bool, message: String) -> void:
_failures.append(message)
func _select_dialog_code(
controller: WhiteboardController,
code: String
) -> void:
var index := controller._find_code_option_index(code)
if index < 0:
return
controller.element_code_option.select(index)
controller.element_code_option.item_selected.emit(index)
controller.update_element_value_hint()
func _set_dialog_free_text(
controller: WhiteboardController,
code: String
) -> void:
var free_index := controller.element_code_option.get_item_index(
WhiteboardController.CODE_OPTION_FREE_ID
)
if free_index < 0:
return
controller.element_code_option.select(free_index)
controller.element_code_option.item_selected.emit(free_index)
controller.element_code_edit.text = code
controller.update_element_value_hint()
func _check_approx(actual: float, expected: float, message: String) -> void:
_check(
absf(actual - expected) <= 0.001,