diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 4c480890..aa5cb55f 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.149 — Compile 1C managed form from JSON or object metadata +# form-compile v1.150 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -6269,13 +6269,17 @@ if ($def.excludedCommands -and $def.excludedCommands.Count -gt 0) { # 12c2. MobileDeviceCommandBarContent — форменный список имён командных панелей/кнопок # (Presentation пустой, CheckState=0, тип xs:string — константы; варьируется только имя-Value). -if ($def.mobileCommandBarContent -and @($def.mobileCommandBarContent).Count -gt 0) { +# $null-проверка (не truthy): одноэлементный массив с пустой строкой @("") разворачивается +# в boolean-контексте в "" → falsy; 12 форм корпуса несут один пустой item (Value=""). +if ($null -ne $def.mobileCommandBarContent -and @($def.mobileCommandBarContent).Count -gt 0) { X "`t" foreach ($nm in @($def.mobileCommandBarContent)) { X "`t`t" X "`t`t`t" X "`t`t`t0" - X "`t`t`t$(Esc-Xml "$nm")" + # пустое значение → самозакрывающийся тег (зеркало платформы) + if ([string]::IsNullOrEmpty("$nm")) { X "`t`t`t" } + else { X "`t`t`t$(Esc-Xml "$nm")" } X "`t`t" } X "`t" diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index ac2946f9..cae41157 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.149 — Compile 1C managed form from JSON or object metadata +# form-compile v1.150 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -6163,13 +6163,18 @@ def main(): # MobileDeviceCommandBarContent — форменный список имён командных панелей/кнопок # (Presentation пустой, CheckState=0, тип xs:string — константы; варьируется только имя-Value). - if defn.get('mobileCommandBarContent') and len(defn['mobileCommandBarContent']) > 0: + # 12 форм корпуса несут один пустой item (Value="") — список присутствует, но не пуст по len. + if defn.get('mobileCommandBarContent') is not None and len(defn['mobileCommandBarContent']) > 0: lines.append('\t') for nm in defn['mobileCommandBarContent']: lines.append('\t\t') lines.append('\t\t\t') lines.append('\t\t\t0') - lines.append(f'\t\t\t{esc_xml(str(nm))}') + # пустое значение → самозакрывающийся тег (зеркало платформы) + if not str(nm): + lines.append('\t\t\t') + else: + lines.append(f'\t\t\t{esc_xml(str(nm))}') lines.append('\t\t') lines.append('\t')