feat: lit/divi-design-detach entkoppelt Variablen – Verweise in Seiten und Presets werden durch den Wert ersetzt (V9)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-19 14:14:49 +02:00
co-authored by Claude Sonnet 5.5
parent 6e9218a2bc
commit e951cc1353
5 changed files with 358 additions and 44 deletions
@@ -216,8 +216,8 @@ pass "mass assignment: dry run lists 2 pages, confirm saved 2 (remaining 0), sec
# 6. detach of the group preset: it is in use, a stale design_rev is refused, then dry run, confirm, delete.
GROUP_ITEM=$(jq -cn --arg g "$PRESET_G" '{items: [{group: "font", preset: $g}]}')
[ "$(error_code "$(ability lit/divi-presets-delete "$GROUP_ITEM")")" = "in_use" ] || fail "delete of a used group preset"
UNSUPPORTED=$(ability lit/divi-design-detach '{"variable": "Irgendeine Variable"}')
[ "$(error_code "$UNSUPPORTED")" = "unsupported" ] || fail "detach of a variable: $UNSUPPORTED"
UNKNOWN_VARIABLE=$(ability lit/divi-design-detach '{"variable": "Irgendeine Variable"}')
[ "$(error_code "$UNKNOWN_VARIABLE")" = "not_found" ] || fail "detach of an unknown variable: $UNKNOWN_VARIABLE"
DETACH=$(jq -cn --arg g "$PRESET_G" '{preset: {group: "font", preset: $g}}')
DRY=$(timed "detach dry run" ability lit/divi-design-detach "$DETACH")
[ "$(error_code "$DRY")" = "confirm_required" ] || fail "detach without confirm: $DRY"
@@ -227,7 +227,7 @@ STALE=$(ability lit/divi-design-detach "$(echo "$DETACH" | jq -c '. + {confirm:
[ "$(error_code "$STALE")" = "rev_mismatch" ] || fail "stale design_rev: $STALE"
nested_groups "$PRESET_B" | jq -e 'length > 0' >/dev/null || fail "stale detach changed preset B"
button_attrs "$PAGE1" | jq -e '(.groupPreset // null) != null' >/dev/null || fail "stale detach changed page 1"
pass "group preset is in use, variable detach unsupported, stale design_rev refused without writing"
pass "group preset is in use, unknown variable not found, stale design_rev refused without writing"
echo "info - preset B before detach: $(preset_item "$PRESET_B")" >&2
DETACHED=$(timed "detach confirmed" ability lit/divi-design-detach "$(echo "$DETACH" | jq -c --arg r "$DETACH_REV" '. + {confirm: true, design_rev: $r}')")