feat(form-decompile,form-compile): дин-список AutoCommandBar — маркер отклонения вместо ADDED

Хвост кластера командных панелей: компилятор-эвристика додумывает Autofill=false
дин-список-таблицам (подавляет панель, чтобы не дублировать КП формы), но ~15%
таблиц имеют голый <AutoCommandBar/> (autofill=true по умолчанию — панель оставлена
при таблице). Раньше эвристика их перетирала → ADDED <Autofill>false>.

Решение (B): эвристика держит дефолт false (оптимальный — 85% дин-списков; контекст-
сигналы проверены по корпусу, ни один не даёт >50% «голых» → улучшать дефолт нечем),
а декомпилятор фиксирует ОТКЛОНЕНИЕ маркером commandBar:{ autofill: true }. commandBar
имеет приоритет над эвристикой.

Компилятор: Emit-CompanionPanel больше не пишет <Autofill>true</Autofill> (платформа
его не эмитит — true это дефолт); только <Autofill>false</Autofill>. autofill:true или
отсутствие → тег опускается, при пустой панели → self-closing <AutoCommandBar/>.

TOTAL diff lines выборки 2.17: 5293 → 5249 (-44). Table>AutoCommandBar ADDED 22 → 0
(полностью закрыт). Остаток AutoCommandBar 18 — форменная панель (heuristic B3, корень
формы) — отдельный пункт. Регресс form-compile 33/33 зелёный на ps + python.
decompile v0.30, compile v1.49.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-06 21:51:26 +03:00
co-authored by Claude Opus 4.8
parent a1a22d1ffe
commit 7b945e786d
4 changed files with 21 additions and 12 deletions
@@ -1,4 +1,4 @@
# form-compile v1.48 — Compile 1C managed form from JSON or object metadata
# form-compile v1.49 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -2281,13 +2281,15 @@ function Emit-CompanionPanel {
$children = $panel.children
}
$hasChildren = $children -and @($children).Count -gt 0
if ($null -eq $autofill -and -not $hasChildren -and -not $halign) {
# Платформа пишет <Autofill> только при false; true = дефолт (тег опускается).
$emitAfFalse = ($autofill -eq $false)
if (-not $emitAfFalse -and -not $hasChildren -and -not $halign) {
X "$indent<$tag name=`"$name`" id=`"$id`"/>"
return
}
X "$indent<$tag name=`"$name`" id=`"$id`">"
if ($halign) { X "$indent`t<HorizontalAlign>$halign</HorizontalAlign>" }
if ($null -ne $autofill) { X "$indent`t<Autofill>$(if ($autofill){'true'}else{'false'})</Autofill>" }
if ($emitAfFalse) { X "$indent`t<Autofill>false</Autofill>" }
if ($hasChildren) {
X "$indent`t<ChildItems>"
foreach ($c in @($children)) { Emit-Element -el $c -indent "$indent`t`t" -inCmdBar $true }
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.48 — Compile 1C managed form from JSON or object metadata
# form-compile v1.49 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -2084,14 +2084,16 @@ def emit_companion_panel(lines, tag, name, indent, panel):
halign = str(panel.get('horizontalAlign'))
children = panel.get('children')
has_children = bool(children) and len(children) > 0
if autofill is None and not has_children and not halign:
# Платформа пишет <Autofill> только при false; true = дефолт (тег опускается).
emit_af_false = (autofill is False)
if not emit_af_false and not has_children and not halign:
lines.append(f'{indent}<{tag} name="{name}" id="{cid}"/>')
return
lines.append(f'{indent}<{tag} name="{name}" id="{cid}">')
if halign:
lines.append(f'{indent}\t<HorizontalAlign>{halign}</HorizontalAlign>')
if autofill is not None:
lines.append(f'{indent}\t<Autofill>{"true" if autofill else "false"}</Autofill>')
if emit_af_false:
lines.append(f'{indent}\t<Autofill>false</Autofill>')
if has_children:
lines.append(f'{indent}\t<ChildItems>')
for c in children: