feat(form-decompile,form-compile): DisplayImportance форменного AutoCommandBar

Форменная командная панель (<AutoCommandBar name="ФормаКоманднаяПанель" id="-1">) может
нести DisplayImportance="Low"/"VeryLow" (адаптивная важность). Декомпилятор не захватывал
этот атрибут, маркер autoCmdBar создавался только при halign/autofill-false/children →
DisplayImportance терялся; компилятор не эмитил.

Декомпилятор: захват $acb DisplayImportance + расширен гейт маркера (DI тоже триггерит
сохранение autoCmdBar-элемента). Компилятор: DI-Attr на тег форменного AutoCommandBar
(обе ветки open/self-closing). Зеркало py. Корпус: 11 форменных ACB с DisplayImportance.

Выборка 11 форм (ПерепискаСКонтролирующимиОрганами/ФормаГрупповойОтправки, …):
match 11/11, TOTAL→0. ps1==py байт-в-байт. Регресс 43/43.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-13 16:21:44 +03:00
parent 831c80d9f0
commit 6cfc504509
3 changed files with 13 additions and 8 deletions
@@ -1,4 +1,4 @@
# form-compile v1.163 — Compile 1C managed form from JSON or object metadata
# form-compile v1.164 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -6364,9 +6364,10 @@ if ($script:mainAcbDef) {
}
}
$hasAcbChildren = ($script:mainAcbDef -and $script:mainAcbDef.children -and $script:mainAcbDef.children.Count -gt 0)
$acbDIAttr = if ($script:mainAcbDef) { DI-Attr $script:mainAcbDef } else { "" } # DisplayImportance форменной панели
$acbHasInner = ($acbHAlign -or (-not $acbAutofill) -or $hasAcbChildren)
if ($acbHasInner) {
X "`t<AutoCommandBar name=`"$acbName`" id=`"-1`">"
X "`t<AutoCommandBar name=`"$acbName`" id=`"-1`"$acbDIAttr>"
if ($acbHAlign) { X "`t`t<HorizontalAlign>$acbHAlign</HorizontalAlign>" }
if (-not $acbAutofill) { X "`t`t<Autofill>false</Autofill>" }
if ($hasAcbChildren) {
@@ -6378,7 +6379,7 @@ if ($acbHasInner) {
}
X "`t</AutoCommandBar>"
} else {
X "`t<AutoCommandBar name=`"$acbName`" id=`"-1`"/>"
X "`t<AutoCommandBar name=`"$acbName`" id=`"-1`"$acbDIAttr/>"
}
# 12e. Events
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.163 — Compile 1C managed form from JSON or object metadata
# form-compile v1.164 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -6273,9 +6273,11 @@ def main():
if main_acb_def.get('horizontalAlign'):
acb_halign = str(main_acb_def['horizontalAlign'])
has_acb_children = bool(main_acb_def and isinstance(main_acb_def.get('children'), list) and len(main_acb_def['children']) > 0)
# DisplayImportance форменной панели (адаптивная важность) — атрибут тега
acb_di_attr = di_attr(main_acb_def) if main_acb_def is not None else ''
has_inner = bool(acb_halign) or (not acb_autofill) or has_acb_children
if has_inner:
lines.append(f'\t<AutoCommandBar name="{acb_name}" id="-1">')
lines.append(f'\t<AutoCommandBar name="{acb_name}" id="-1"{acb_di_attr}>')
if acb_halign:
lines.append(f'\t\t<HorizontalAlign>{acb_halign}</HorizontalAlign>')
if not acb_autofill:
@@ -6287,7 +6289,7 @@ def main():
lines.append('\t\t</ChildItems>')
lines.append('\t</AutoCommandBar>')
else:
lines.append(f'\t<AutoCommandBar name="{acb_name}" id="-1"/>')
lines.append(f'\t<AutoCommandBar name="{acb_name}" id="-1"{acb_di_attr}/>')
# Events
if defn.get('events'):
@@ -1,4 +1,4 @@
# form-decompile v0.138 — Decompile 1C managed Form.xml to JSON DSL (draft)
# form-decompile v0.139 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -2583,11 +2583,13 @@ $acb = $root.SelectSingleNode("lf:AutoCommandBar", $ns)
if ($acb) {
$haln = Get-Child $acb 'HorizontalAlign'
$acbAutofill = Get-Child $acb 'Autofill'
$acbDI = $acb.GetAttribute("DisplayImportance") # адаптивная важность форменной панели (атрибут тега)
$acbKids = Decompile-Children $acb
$acbObj = $null
if ($haln -or ($acbAutofill -eq 'false') -or $acbKids) {
if ($haln -or ($acbAutofill -eq 'false') -or $acbKids -or $acbDI) {
$acbObj = [ordered]@{}
$acbObj['autoCmdBar'] = $acb.GetAttribute("name")
if ($acbDI) { $acbObj['displayImportance'] = $acbDI }
if ($haln) { $acbObj['horizontalAlign'] = $haln }
if ($acbAutofill -eq 'false') { $acbObj['autofill'] = $false }
if ($acbKids) { $acbObj['children'] = $acbKids }