From 52478a6c39fc741222a7cc7979860489a18dc552 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 31 May 2026 17:26:23 +0300 Subject: [PATCH] =?UTF-8?q?fix(form-compile):=20=D1=8D=D0=BC=D0=B8=D1=82?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20true=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20choiceButton:true=20+=20StartChoice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Компилятор выводил тег только для значения false; при choiceButton:true он не эмитился, и у нессылочного поля (например строкового с обработчиком НачалоВыбора) кнопка выбора не отрисовывалась — документированный паттерн (SKILL.md: choiceButton:true + on:['StartChoice']) фактически не работал. Теперь true эмитится, но узко: только когда у поля есть обработчик StartChoice — чтобы не раздувать вывод по ссылочным полям (у них choiceButton=true стоит по умолчанию, а кнопка платформенная). Порты ps1+py синхронны. Снапшот file-dialog обновлён, 31/31 кейс зелёные на обоих портах. Co-Authored-By: Claude Opus 4.8 --- .claude/skills/form-compile/scripts/form-compile.ps1 | 3 ++- .claude/skills/form-compile/scripts/form-compile.py | 4 +++- .../DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 87c802d2..d2981494 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -1,4 +1,4 @@ -# form-compile v1.22 — Compile 1C managed form from JSON or object metadata +# form-compile v1.23 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -2134,6 +2134,7 @@ function Emit-Input { if ($el.multiLine -eq $true) { X "$innertrue" } if ($el.passwordMode -eq $true) { X "$innertrue" } if ($el.choiceButton -eq $false) { X "$innerfalse" } + elseif ($el.choiceButton -eq $true -and ($el.on -contains 'StartChoice')) { X "$innertrue" } if ($el.clearButton -eq $true) { X "$innertrue" } if ($el.spinButton -eq $true) { X "$innertrue" } if ($el.dropListButton -eq $true) { X "$innertrue" } diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 4c4a1ad2..9910f9b7 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# form-compile v1.22 — Compile 1C managed form from JSON or object metadata +# form-compile v1.23 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -1933,6 +1933,8 @@ def emit_input(lines, el, name, eid, indent): lines.append(f'{inner}true') if el.get('choiceButton') is False: lines.append(f'{inner}false') + elif el.get('choiceButton') is True and 'StartChoice' in (el.get('on') or []): + lines.append(f'{inner}true') if el.get('clearButton') is True: lines.append(f'{inner}true') if el.get('spinButton') is True: diff --git a/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml index e023bcb8..38352ce8 100644 --- a/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml @@ -38,6 +38,7 @@ Файл + true ru