diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1
index 532fbff3..963281fe 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.58 — Compile 1C managed form from JSON or object metadata
+# form-compile v1.59 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -2392,7 +2392,9 @@ function Emit-Element {
$typeKey = $null
$xmlTag = $null
- foreach ($key in @("columnGroup","buttonGroup","group","input","check","radio","label","labelField","table","pages","page","button","picture","picField","calendar","cmdBar","popup")) {
+ # picture/picField — НИЗКИЙ приоритет: 'picture' это и тип (PictureDecoration), и свойство-иконка
+ # у popup/button/cmdBar. Тип-ключ владельца (popup/button/…) должен выиграть.
+ foreach ($key in @("columnGroup","buttonGroup","group","input","check","radio","label","labelField","table","pages","page","button","calendar","cmdBar","popup","picField","picture")) {
if ($el.$key -ne $null) {
$typeKey = $key
break
@@ -3384,6 +3386,8 @@ function Emit-Button {
X "$innerForm.StandardCommand.$sc"
}
}
+ # DataPath — привязка команды кнопки к контексту (Объект.Ref, Items.X.CurrentData.Поле)
+ if ($el.path) { X "$inner$($el.path)" }
$btnAuto = -not ($el.command -or $el.commandName -or $el.stdCommand)
Emit-Title -el $el -name $name -indent $inner -auto:$btnAuto
diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py
index 4a8be6f8..0dfb5b3f 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.58 — Compile 1C managed form from JSON or object metadata
+# form-compile v1.59 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -1796,8 +1796,10 @@ KNOWN_KEYS = {
"userSettingsGroup", "rowsPicture",
}
+# picture/picField — НИЗКИЙ приоритет: 'picture' это и тип (PictureDecoration), и свойство-иконка
+# у popup/button/cmdBar. Тип-ключ владельца (popup/button/…) должен выиграть.
TYPE_KEYS = ["columnGroup", "buttonGroup", "group", "input", "check", "radio", "label", "labelField", "table", "pages", "page",
- "button", "picture", "picField", "calendar", "cmdBar", "popup"]
+ "button", "calendar", "cmdBar", "popup", "picField", "picture"]
# Synonyms: model often writes XML name or Russian (ПолеПереключателя/RadioButtonField → radio)
ELEMENT_TYPE_SYNONYMS = {
@@ -3081,6 +3083,9 @@ def emit_button(lines, el, name, eid, indent, in_cmd_bar=False):
lines.append(f'{inner}Form.Item.{m.group(1)}.StandardCommand.{m.group(2)}')
else:
lines.append(f'{inner}Form.StandardCommand.{sc}')
+ # DataPath — привязка команды кнопки к контексту (Объект.Ref, Items.X.CurrentData.Поле)
+ if el.get('path'):
+ lines.append(f'{inner}{el["path"]}')
emit_title(lines, el, name, inner, auto=not (el.get('command') or el.get('commandName') or el.get('stdCommand')))
emit_common_flags(lines, el, inner)
diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1
index 5d352865..854c5e7b 100644
--- a/.claude/skills/form-decompile/scripts/form-decompile.ps1
+++ b/.claude/skills/form-decompile/scripts/form-decompile.ps1
@@ -1,4 +1,4 @@
-# form-decompile v0.40 — Decompile 1C managed Form.xml to JSON DSL (draft)
+# form-decompile v0.41 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -1188,6 +1188,7 @@ function Decompile-Element {
elseif ($cmd -match '^Form\.Item\.(.+)\.StandardCommand\.(.+)$') { $obj['stdCommand'] = "$($matches[1]).$($matches[2])" }
else { $obj['commandName'] = $cmd }
}
+ $dp = Get-Child $node 'DataPath'; if ($dp) { $obj['path'] = $dp }
Add-CommonProps $obj $node $name
$type = Get-Child $node 'Type'
if ($type) { $tmap=@{'CommandBarButton'='commandBar';'UsualButton'='usual';'Hyperlink'='hyperlink';'CommandBarHyperlink'='hyperlink'}; if ($tmap.ContainsKey($type)) { $obj['type']=$tmap[$type] } else { $obj['type']=$type } }
diff --git a/tests/skills/cases/form-compile/button-group.json b/tests/skills/cases/form-compile/button-group.json
index 80c0b00f..9042f7be 100644
--- a/tests/skills/cases/form-compile/button-group.json
+++ b/tests/skills/cases/form-compile/button-group.json
@@ -22,7 +22,10 @@
{ "button": "Вверх", "command": "Вверх" },
{ "button": "Вниз", "command": "Вниз" }
]},
- { "buttonGroup": "ГруппаГлобальныеКоманды", "commandSource": "FormCommandPanelGlobalCommands" }
+ { "buttonGroup": "ГруппаГлобальныеКоманды", "commandSource": "FormCommandPanelGlobalCommands" },
+ { "popup": "ПодменюПечать", "title": "Печать", "picture": "StdPicture.Print", "representation": "PictureAndText", "children": [
+ { "button": "ПечатьСчёта", "command": "Выполнить" }
+ ]}
]}
],
"attributes": [
diff --git a/tests/skills/cases/form-compile/snapshots/button-group/DataProcessors/ГруппыКнопок/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/button-group/DataProcessors/ГруппыКнопок/Forms/Форма/Ext/Form.xml
index eac7521d..88bec9d1 100644
--- a/tests/skills/cases/form-compile/snapshots/button-group/DataProcessors/ГруппыКнопок/Forms/Форма/Ext/Form.xml
+++ b/tests/skills/cases/form-compile/snapshots/button-group/DataProcessors/ГруппыКнопок/Forms/Форма/Ext/Form.xml
@@ -45,11 +45,32 @@
FormCommandPanelGlobalCommands
+
+
+
+ ru
+ Печать
+
+
+
+ StdPicture.Print
+ true
+
+ PictureAndText
+
+
+
+
+
-
+
cfg:DataProcessorObject.ГруппыКнопок
@@ -57,7 +78,7 @@
-
+
ru
@@ -73,7 +94,7 @@
ВыполнитьОбработка
Ctrl+Enter
-
+
ru
@@ -83,7 +104,7 @@
ВверхОбработка
DontUse
-
+
ru