feat(form-decompile,form-compile): эмиссия оформления Page/Popup + ColumnGroup HeaderPicture + whitespace Title/ToolTip

Декомпилятор ловил эти свойства (Add-CommonProps/Add-Appearance), но эмиттеры
компилятора их не выводили → LOST. Четыре подфикса (по выбору пользователя из топа
list-iter):

1. Page>BackColor/TitleTextColor/TitleFont (193+): Emit-Page не звал Emit-Appearance.
   Добавлен (profile field, после ShowTitle перед компаньоном — порядок корпуса).
2. Popup>TitleTextColor/TitleFont (133/127): Emit-Popup не звал Emit-Appearance. Добавлен.
3. ColumnGroup>HeaderPicture (144): Emit-ColumnGroup не звал Emit-ColumnPics. Добавлен
   (после ShowInHeader/Layout перед оформлением — порядок корпуса).
4. UsualGroup Title/ToolTip с whitespace-контентом: Add-CommonProps читал title/tooltip
   через Get-LangText (PreserveWhitespace=false стрипал <v8:content> </> → "" →
   компилятор подавлял). Новый Get-LangTextWS восстанавливает " " (как Get-MLFormattedValue).
   1-пробельные tooltip'ы теперь матчатся; редкий N-пробельный → косметика числа пробелов.

Зеркало py. Выборка 40 форм с этими категориями: целевые потери 0 (match 21,
остаток — несвязанный хвост). Кейсы pages (+backColor/titleTextColor/titleFont),
column-group (+headerPicture), button-group (popup +titleTextColor/titleFont)
сертифицированы в 1С. Регресс 43/43 (ps1+py).

Раскрыто (отдельно): MultipleValuesBackColor (input) — другой appearance-ключ.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-11 20:04:09 +03:00
co-authored by Claude Opus 4.8
parent c96bcc3566
commit 32273d2be8
10 changed files with 49 additions and 10 deletions
@@ -1,4 +1,4 @@
# form-compile v1.119 — Compile 1C managed form from JSON or object metadata
# form-compile v1.120 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -3555,6 +3555,9 @@ function Emit-ColumnGroup {
Emit-CommonFlags -el $el -indent $inner
Emit-Layout -el $el -indent $inner
# Картинка заголовка колонки-группы (после ShowInHeader/Layout, перед оформлением — порядок XSD)
Emit-ColumnPics -el $el -indent $inner
# Оформление (цвета/шрифты/граница) — перед компаньоном
Emit-Appearance -el $el -indent $inner -profile 'field'
@@ -4387,6 +4390,9 @@ function Emit-Page {
if ($el.showTitle -eq $false) { X "$inner<ShowTitle>false</ShowTitle>" }
Emit-Layout -el $el -indent $inner
# Оформление страницы (BackColor / TitleTextColor / TitleFont) — после ShowTitle, перед компаньоном
Emit-Appearance -el $el -indent $inner -profile 'field'
# Companion
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
@@ -4753,6 +4759,10 @@ function Emit-Popup {
X "$inner<Representation>$($el.representation)</Representation>"
}
Emit-Layout -el $el -indent $inner
# Оформление попапа (TitleTextColor / TitleFont) — перед компаньоном
Emit-Appearance -el $el -indent $inner -profile 'field'
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
# Children
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.119 — Compile 1C managed form from JSON or object metadata
# form-compile v1.120 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -3642,6 +3642,9 @@ def emit_column_group(lines, el, name, eid, indent):
emit_common_flags(lines, el, inner)
emit_layout(lines, el, inner)
# Картинка заголовка колонки-группы (после ShowInHeader/Layout, перед оформлением — порядок XSD)
emit_column_pics(lines, el, inner)
# Оформление (цвета/шрифты/граница) — перед компаньоном
emit_appearance(lines, el, inner, 'field')
@@ -4112,6 +4115,9 @@ def emit_page(lines, el, name, eid, indent):
lines.append(f'{inner}<ShowTitle>false</ShowTitle>')
emit_layout(lines, el, inner)
# \u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (BackColor / TitleTextColor / TitleFont) \u2014 \u043f\u043e\u0441\u043b\u0435 ShowTitle, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d\u043e\u043c
emit_appearance(lines, el, inner, 'field')
# Companion
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
@@ -4433,6 +4439,10 @@ def emit_popup(lines, el, name, eid, indent):
if el.get('representation'):
lines.append(f'{inner}<Representation>{el["representation"]}</Representation>')
emit_layout(lines, el, inner)
# Оформление попапа (TitleTextColor / TitleFont) — перед компаньоном
emit_appearance(lines, el, inner, 'field')
emit_companion(lines, 'ExtendedTooltip', f'{name}РасширеннаяПодсказка', inner, el.get('extendedTooltip'))
# Children
@@ -1,4 +1,4 @@
# form-decompile v0.95 — Decompile 1C managed Form.xml to JSON DSL (draft)
# form-decompile v0.96 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -274,6 +274,16 @@ function Get-LangText {
return $map
}
# Get-LangText с восстановлением значимого пробела: PreserveWhitespace=false стрипает
# <v8:content> </v8:content> → "" (неотличимо от суппресса). Платформа НЕ эмитит пустой
# Title/ToolTip, значит исходно был пробел → возвращаем " " (как Get-MLFormattedValue).
function Get-LangTextWS {
param($node)
$t = Get-LangText $node
if ($t -is [string] -and $t -eq '' -and $node.SelectSingleNode("v8:item/v8:content", $ns)) { return ' ' }
return $t
}
# Авто-вывод заголовка из имени — ТОЧНОЕ зеркало Title-FromName из form-compile.
# Нужен, чтобы опускать ru-only заголовки, которые компилятор воспроизведёт сам.
function Title-FromName {
@@ -1074,12 +1084,12 @@ function Add-CommonProps {
$uv = Decompile-XrFlag $node 'UserVisible'; if ($null -ne $uv) { $obj['userVisible'] = $uv }
$titleNode = $node.SelectSingleNode("lf:Title", $ns)
if ($titleNode) {
$t = Get-LangText $titleNode
$t = Get-LangTextWS $titleNode # восстановление значимого пробела (whitespace-заголовок)
if ($null -ne $t) { $obj['title'] = $t }
# formatted у LabelDecoration выводится компилятором из hyperlink — отдельный ключ не нужен (#16 хвост)
}
$ttNode = $node.SelectSingleNode("lf:ToolTip", $ns)
if ($ttNode) { $tt = Get-LangText $ttNode; if ($null -ne $tt) { $obj['tooltip'] = $tt } }
if ($ttNode) { $tt = Get-LangTextWS $ttNode; if ($null -ne $tt) { $obj['tooltip'] = $tt } }
$ttr = Get-Child $node 'ToolTipRepresentation'; if ($ttr) { $obj['tooltipRepresentation'] = $ttr }
# Картинки заголовка/подвала колонки (любой field-тип, эмитятся платформой как column header/footer icon)
$hp = Get-PictureRef $node 'HeaderPicture'; if ($null -ne $hp) { $obj['headerPicture'] = $hp }