diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index fa3a8097..4fe62c53 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.159 — Compile 1C managed form from JSON or object metadata +# form-compile v1.160 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -2606,7 +2606,9 @@ function Emit-Companion { return } $inner = "$indent`t" - X "$indent<$tag name=`"$name`" id=`"$id`"$(DI-Attr $el)>" + # DI-Attr берём от СОБСТВЕННОГО объекта компаньона ($content), НЕ от ambient $el родителя + # (PowerShell dynamic scope — иначе companion наследует DisplayImportance владельца: баг). + X "$indent<$tag name=`"$name`" id=`"$id`"$(DI-Attr $content)>" if (Test-CompanionStructured $content) { # структурированная форма (own-content). Порядок как у платформы: own-content (флаги/hyperlink/ # layout/оформление) ПЕРЕД Title (в корпусе layout-first 582 vs 10). @@ -2649,7 +2651,7 @@ function Emit-CompanionPanel { X "$indent<$tag name=`"$name`" id=`"$id`"/>" return } - X "$indent<$tag name=`"$name`" id=`"$id`"$(DI-Attr $el)>" + X "$indent<$tag name=`"$name`" id=`"$id`"$(DI-Attr $panel)>" if ($halign) { X "$indent`t$halign" } if ($emitAfFalse) { X "$indent`tfalse" } if ($hasChildren) { diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 61ef25da..45ce8f35 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.159 — Compile 1C managed form from JSON or object metadata +# form-compile v1.160 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -2628,7 +2628,8 @@ def emit_companion(lines, tag, name, indent, content=None): lines.append(f'{indent}<{tag} name="{name}" id="{cid}"/>') return inner = f'{indent}\t' - lines.append(f'{indent}<{tag} name="{name}" id="{cid}">') + # DI-Attr от собственного объекта компаньона (не от владельца) — зеркало ps1 + lines.append(f'{indent}<{tag} name="{name}" id="{cid}"{di_attr(content if isinstance(content, dict) else None)}>') if isinstance(content, dict) and any(k in content for k in COMPANION_STRUCT_KEYS): # own-content ПЕРЕД Title (в корпусе layout-first 582 vs 10). emit_common_flags(lines, content, inner) @@ -2669,7 +2670,7 @@ def emit_companion_panel(lines, tag, name, indent, panel): if not emit_af_false and not has_children and not halign: lines.append(f'{indent}<{tag} name="{name}" id="{cid}"/>') return - lines.append(f'{indent}<{tag} name="{name}" id="{cid}">') + lines.append(f'{indent}<{tag} name="{name}" id="{cid}"{di_attr(panel if isinstance(panel, dict) else None)}>') if halign: lines.append(f'{indent}\t{halign}') if emit_af_false: