feat(skd-edit): clear-conditionalAppearance + multiline patch-query (доки)

- Новая операция clear-conditionalAppearance в стиле clear-selection/
  order/filter. Закрывает потребность "заменить набор правил оформления"
  через clear + re-add.
- patch-query: многострочные подстроки уже работали (string.Replace
  корректно обрабатывает \n). Зафиксировано в SKILL.md.
- add-total: shorthand-шаблон с тремя случаями (Func, Func(expr),
  identity-выражение) — после fix Bug 6 поведение нужно явно объяснить.
- Косметика: убрана утечка XML-внутренностей в комментарии примера
  set-field-role @period.
- Пример patch-query @once заменён на более типовой случай уникальной
  подстроки (КАК ВТ_СтароеИмя вместо ЛЕВОЕ СОЕДИНЕНИЕ).

Регресс: 33/33 PS, 33/33 PY, 33/33 платформенный verify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-05-15 17:39:24 +03:00
co-authored by Claude Opus 4.7
parent 28a2a34c84
commit 7fa279c354
5 changed files with 108 additions and 8 deletions
+14 -2
View File
@@ -1,4 +1,4 @@
# skd-edit v1.17 — Atomic 1C DCS editor
# skd-edit v1.18 — Atomic 1C DCS editor
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[Parameter(Mandatory)]
@@ -13,7 +13,7 @@ param(
"set-query","patch-query","set-outputParameter","set-structure",
"modify-field","modify-filter","modify-dataParameter","modify-parameter","modify-structure","set-field-role",
"rename-parameter","reorder-parameters",
"clear-selection","clear-order","clear-filter",
"clear-selection","clear-order","clear-filter","clear-conditionalAppearance",
"remove-field","remove-total","remove-calculated-field","remove-parameter","remove-filter")]
[string]$Operation,
@@ -2858,6 +2858,18 @@ switch ($Operation) {
}
}
"clear-conditionalAppearance" {
$settings = Resolve-VariantSettings
$varName = Get-VariantName
$caEl = Find-FirstElement $settings @("conditionalAppearance") $setNs
if ($caEl) {
Clear-ContainerChildren $caEl
Write-Host "[OK] ConditionalAppearance cleared in variant `"$varName`""
} else {
Write-Host "[INFO] No conditionalAppearance section in variant `"$varName`""
}
}
"modify-filter" {
$settings = Resolve-VariantSettings
$varName = Get-VariantName
+12 -2
View File
@@ -1,4 +1,4 @@
# skd-edit v1.17 — Atomic 1C DCS editor (Python port)
# skd-edit v1.18 — Atomic 1C DCS editor (Python port)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import os
@@ -20,7 +20,7 @@ VALID_OPS = [
"set-query", "patch-query", "set-outputParameter", "set-structure",
"modify-field", "modify-filter", "modify-dataParameter", "modify-parameter", "modify-structure", "set-field-role",
"rename-parameter", "reorder-parameters",
"clear-selection", "clear-order", "clear-filter",
"clear-selection", "clear-order", "clear-filter", "clear-conditionalAppearance",
"remove-field", "remove-total", "remove-calculated-field", "remove-parameter", "remove-filter",
]
@@ -2380,6 +2380,16 @@ elif operation == "clear-filter":
else:
print(f'[INFO] No filter section in variant "{var_name}"')
elif operation == "clear-conditionalAppearance":
settings = resolve_variant_settings()
var_name = get_variant_name()
ca_el = find_first_element(settings, ["conditionalAppearance"], SET_NS)
if ca_el is not None:
clear_container_children(ca_el)
print(f'[OK] ConditionalAppearance cleared in variant "{var_name}"')
else:
print(f'[INFO] No conditionalAppearance section in variant "{var_name}"')
elif operation == "modify-filter":
settings = resolve_variant_settings()
var_name = get_variant_name()