feat(form-decompile,form-compile): HorizontalStretch/VerticalStretch — захват явного false

Растягивание (<HorizontalStretch>/<VerticalStretch>) платформа эмитит явным значением
(false 38145 / true 25002 для HS; на Input/Label/Picture/Group/CommandBar). Декомпилятор/
компилятор работали только с true → явный false терялся.

Теперь захват и эмиссия фактического значения (true И false); отсутствие = дефолт
(не эмитим). Бэк-совместимо: true как раньше, +false. Раньше декомпилятор писал ключ
лишь при true — теперь и при false.

TOTAL diff lines выборки 2.17: 2912 → 2727 (-185), match 20 → 22. Stretch residual
92 → 1 (остаток — на companion ExtendedTooltip, отдельный кластер). Снапшот input-fields
(+stretch false) сертифицирован в 1С (8.3.24). Регресс form-compile 34/34 зелёный
на ps + python. decompile v0.40, compile v1.58.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-07 15:11:12 +03:00
co-authored by Claude Opus 4.8
parent 701d56b075
commit 5112dbec9e
6 changed files with 17 additions and 14 deletions
@@ -1,4 +1,4 @@
# form-compile v1.57 — Compile 1C managed form from JSON or object metadata
# form-compile v1.58 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -2568,8 +2568,8 @@ function Emit-Layout {
if ($null -ne $el.maxHeight) { X "$indent<MaxHeight>$($el.maxHeight)</MaxHeight>" }
if ($el.width) { X "$indent<Width>$($el.width)</Width>" }
if (-not $skipHeight -and $el.height) { X "$indent<Height>$($el.height)</Height>" }
if ($el.horizontalStretch -eq $true) { X "$indent<HorizontalStretch>true</HorizontalStretch>" }
if ($el.verticalStretch -eq $true) { X "$indent<VerticalStretch>true</VerticalStretch>" }
if ($null -ne $el.horizontalStretch) { X "$indent<HorizontalStretch>$(if ($el.horizontalStretch){'true'}else{'false'})</HorizontalStretch>" }
if ($null -ne $el.verticalStretch) { X "$indent<VerticalStretch>$(if ($el.verticalStretch){'true'}else{'false'})</VerticalStretch>" }
if ($el.groupHorizontalAlign) { X "$indent<GroupHorizontalAlign>$($el.groupHorizontalAlign)</GroupHorizontalAlign>" }
if ($el.groupVerticalAlign) { X "$indent<GroupVerticalAlign>$($el.groupVerticalAlign)</GroupVerticalAlign>" }
if ($el.horizontalAlign) { X "$indent<HorizontalAlign>$($el.horizontalAlign)</HorizontalAlign>" }
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.57 — Compile 1C managed form from JSON or object metadata
# form-compile v1.58 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -2232,10 +2232,10 @@ def emit_layout(lines, el, indent, skip_height=False, multi_line_default=False):
lines.append(f"{indent}<Width>{el['width']}</Width>")
if not skip_height and el.get('height'):
lines.append(f"{indent}<Height>{el['height']}</Height>")
if el.get('horizontalStretch') is True:
lines.append(f"{indent}<HorizontalStretch>true</HorizontalStretch>")
if el.get('verticalStretch') is True:
lines.append(f"{indent}<VerticalStretch>true</VerticalStretch>")
if el.get('horizontalStretch') is not None:
lines.append(f'{indent}<HorizontalStretch>{"true" if el["horizontalStretch"] else "false"}</HorizontalStretch>')
if el.get('verticalStretch') is not None:
lines.append(f'{indent}<VerticalStretch>{"true" if el["verticalStretch"] else "false"}</VerticalStretch>')
if el.get('groupHorizontalAlign'):
lines.append(f"{indent}<GroupHorizontalAlign>{el['groupHorizontalAlign']}</GroupHorizontalAlign>")
if el.get('groupVerticalAlign'):