mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 14:41:02 +03:00
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:
co-authored by
Claude Opus 4.8
parent
a1a22d1ffe
commit
7b945e786d
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.29 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.30 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -885,8 +885,9 @@ function Decompile-Children {
|
||||
|
||||
# Инверсия Emit-CompanionPanel: companion-командная-панель (ContextMenu/AutoCommandBar) с контентом
|
||||
# → { autofill?, horizontalAlign?, children?[] } либо $null, если companion пустой (self-closing).
|
||||
# $isDynListTable: для дин-список-таблицы пустой AutoCommandBar с autofill=false восстановит
|
||||
# эвристика компилятора — молчим (как с tableAutofill), чтобы не плодить ключ.
|
||||
# Дин-список-таблица: компилятор-эвристика додумывает Autofill=false. Выражаем только ОТКЛОНЕНИЕ:
|
||||
# autofill=false (нет детей) → совпадает с дефолтом → молчим;
|
||||
# голый <AutoCommandBar/> (autofill=true по умолчанию) → маркер { autofill: true } (панель не скрыта).
|
||||
function Decompile-CompanionPanel {
|
||||
param($node, [string]$tag, [bool]$isDynListTable = $false)
|
||||
$p = $node.SelectSingleNode("lf:$tag", $ns)
|
||||
@@ -895,8 +896,11 @@ function Decompile-CompanionPanel {
|
||||
$halign = Get-Child $p 'HorizontalAlign'
|
||||
$kids = Decompile-Children $p
|
||||
$hasKids = $kids -and @($kids).Count -gt 0
|
||||
if ($isDynListTable -and $tag -eq 'AutoCommandBar' -and -not $hasKids -and -not $halign) {
|
||||
if ($autofillRaw -eq 'false') { return $null } # = дефолт эвристики → молчим
|
||||
return [ordered]@{ autofill = $true } # голая панель → отклонение
|
||||
}
|
||||
if (-not $hasKids -and $null -eq $autofillRaw -and -not $halign) { return $null }
|
||||
if ($isDynListTable -and $tag -eq 'AutoCommandBar' -and -not $hasKids -and -not $halign -and $autofillRaw -eq 'false') { return $null }
|
||||
$o = [ordered]@{}
|
||||
if ($halign) { $o['horizontalAlign'] = $halign }
|
||||
if ($autofillRaw -eq 'false') { $o['autofill'] = $false }
|
||||
|
||||
Reference in New Issue
Block a user