From b5769ce37315faa4e2f4e06790e1dbbd4cb4ca15 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Tue, 9 Jun 2026 19:38:31 +0300 Subject: [PATCH] =?UTF-8?q?feat(form-decompile,form-compile):=20report-for?= =?UTF-8?q?m=20=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82=D0=B2=D0=B0=20+=203=20?= =?UTF-8?q?=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=D0=BB=D1=8F=D1=80=D0=B0=20(=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BA=D1=80=D1=8B=D1=82=D0=BE=20=D0=B8=D0=B7-=D0=BF?= =?UTF-8?q?=D0=BE=D0=B4=20ring-3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Закрытие спец-полей раскрыло пробелы в формах Report-объектов (доминируют среди SpreadSheet-форм). 6 форменных скаляров report-формы → KNOWN_FORM_PROPS (decompiler-only; компилятор уже эмитит через Emit-Properties): ReportResult/ DetailsData (имена реквизитов), ReportFormType (Main/Settings/Variant), AutoShowState (Auto/DontShow/ShowOnComposition), ReportResultViewMode/ ViewModeApplicationOnSetReportResult (всегда Auto). + 3 элементных generic-скаляра (обе стороны, +py): HorizontalSpacing (группа, 3592 в корпусе), RepresentationInContextMenu (кнопка, 1673), SettingsNamedItemDetailedRepresentation (таблица, 778). Выборка 2.17: TOTAL 101→23, match 166→170, diff 17→13 (ring3 37, 0 крашей). Кейсы groups/commands/table расширены и сертифицированы загрузкой в 1С. Регресс 40/40 (ps1+py). Co-Authored-By: Claude Opus 4.8 --- .claude/skills/form-compile/scripts/form-compile.ps1 | 8 +++++++- .claude/skills/form-compile/scripts/form-compile.py | 8 +++++++- .claude/skills/form-decompile/scripts/form-decompile.ps1 | 8 ++++++-- docs/form-dsl-spec.md | 6 ++++++ tests/skills/cases/form-compile/commands.json | 2 +- tests/skills/cases/form-compile/groups.json | 2 +- .../DataProcessors/Команды/Forms/Форма/Ext/Form.xml | 1 + .../DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml | 1 + .../table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml | 1 + tests/skills/cases/form-compile/table.json | 2 +- 10 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 62f3d8da..1ffce5ee 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.95 — Compile 1C managed form from JSON or object metadata +# form-compile v1.96 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -2614,6 +2614,8 @@ function Emit-Element { "horizontalScrollBar"=1;"viewScalingMode"=1;"output"=1;"selectionShowMode"=1;"protection"=1 "edit"=1;"showGrid"=1;"showGroups"=1;"showHeaders"=1;"showRowAndColumnNames"=1;"showCellNames"=1 "pointerType"=1;"drawingSelectionShowMode"=1;"warningOnEditRepresentation"=1;"markingAppearance"=1 + # report-form контекст (generic-скаляры элементов) + "horizontalSpacing"=1;"representationInContextMenu"=1;"settingsNamedItemDetailedRepresentation"=1 # columnGroup-specific "showInHeader"=1 # radio-specific @@ -2914,6 +2916,10 @@ $script:genericScalars = @( @{ Tag='ShowRowAndColumnNames'; Key='showRowAndColumnNames'; Kind='bool' } @{ Tag='ShowCellNames'; Key='showCellNames'; Kind='bool' } @{ Tag='ShowPercent'; Key='showPercent'; Kind='bool' } + # Report-form контекст: интервал группы / представление кнопки в контекстном меню / детальное представление настройки таблицы + @{ Tag='HorizontalSpacing'; Key='horizontalSpacing'; Kind='value' } + @{ Tag='RepresentationInContextMenu'; Key='representationInContextMenu'; Kind='value' } + @{ Tag='SettingsNamedItemDetailedRepresentation'; Key='settingsNamedItemDetailedRepresentation'; Kind='bool' } ) function Emit-GenericScalars { diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 34840d66..1553d3a4 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.95 — Compile 1C managed form from JSON or object metadata +# form-compile v1.96 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -1835,6 +1835,8 @@ KNOWN_KEYS = { "horizontalScrollBar", "viewScalingMode", "output", "selectionShowMode", "protection", "edit", "showGrid", "showGroups", "showHeaders", "showRowAndColumnNames", "showCellNames", "pointerType", "drawingSelectionShowMode", "warningOnEditRepresentation", "markingAppearance", + # report-form контекст (generic-скаляры элементов) + "horizontalSpacing", "representationInContextMenu", "settingsNamedItemDetailedRepresentation", } # picture/picField — НИЗКИЙ приоритет: 'picture' это и тип (PictureDecoration), и свойство-иконка @@ -2735,6 +2737,10 @@ GENERIC_SCALARS = [ ('ShowRowAndColumnNames', 'showRowAndColumnNames', 'bool'), ('ShowCellNames', 'showCellNames', 'bool'), ('ShowPercent', 'showPercent', 'bool'), + # Report-form контекст: интервал группы / представление кнопки в контекстном меню / детальное представление настройки таблицы + ('HorizontalSpacing', 'horizontalSpacing', 'value'), + ('RepresentationInContextMenu', 'representationInContextMenu', 'value'), + ('SettingsNamedItemDetailedRepresentation', 'settingsNamedItemDetailedRepresentation', 'bool'), ] diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index 207f9f6e..814dd5a7 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.71 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.72 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -1188,6 +1188,10 @@ $GENERIC_SCALARS = @( @{ Tag='ShowRowAndColumnNames'; Key='showRowAndColumnNames'; Kind='bool' } @{ Tag='ShowCellNames'; Key='showCellNames'; Kind='bool' } @{ Tag='ShowPercent'; Key='showPercent'; Kind='bool' } + # Report-form контекст: интервал группы / представление кнопки в контекстном меню / детальное представление настройки таблицы + @{ Tag='HorizontalSpacing'; Key='horizontalSpacing'; Kind='value' } + @{ Tag='RepresentationInContextMenu'; Key='representationInContextMenu'; Kind='value' } + @{ Tag='SettingsNamedItemDetailedRepresentation'; Key='settingsNamedItemDetailedRepresentation'; Kind='bool' } ) # Захват generic-скаляров. Специфичная обработка (если ключ уже задан) — побеждает. @@ -1758,7 +1762,7 @@ $titleNode = $root.SelectSingleNode("lf:Title", $ns) if ($titleNode) { $t = Get-LangText $titleNode; if ($null -ne $t) { $dsl['title'] = $t } } # properties (прямые скаляры под
, PascalCase → camelCase) -$KNOWN_FORM_PROPS = @('AutoTitle','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing') +$KNOWN_FORM_PROPS = @('AutoTitle','ReportResult','DetailsData','ReportFormType','AutoShowState','ReportResultViewMode','ViewModeApplicationOnSetReportResult','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing') $props = [ordered]@{} foreach ($pn in $KNOWN_FORM_PROPS) { $v = Get-Child $root $pn diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index f77f0c8e..f62af6d4 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -67,6 +67,12 @@ | `height` | `` | число | | `group` | `` | `Vertical`, `Horizontal`, `AlwaysHorizontal`, `AlwaysVertical` | | `useForFoldersAndItems` | `` | `Folders`, `Items`, `FoldersAndItems` | +| `reportResult` | `` | Имя реквизита-результата (форма отчёта) | +| `detailsData` | `` | Имя реквизита данных расшифровки (форма отчёта) | +| `reportFormType` | `` | `Main`, `Settings`, `Variant` | +| `autoShowState` | `` | `Auto`, `DontShow`, `ShowOnComposition` | +| `reportResultViewMode` | `` | `Auto` | +| `viewModeApplicationOnSetReportResult` | `` | `Auto` | Нераспознанные ключи преобразуются с автоматическим PascalCase (первая буква в верхний регистр). diff --git a/tests/skills/cases/form-compile/commands.json b/tests/skills/cases/form-compile/commands.json index c938abcd..7f1d393f 100644 --- a/tests/skills/cases/form-compile/commands.json +++ b/tests/skills/cases/form-compile/commands.json @@ -19,7 +19,7 @@ "elements": [ { "cmdBar": "Панель", "horizontalLocation": "right", "children": [ { "button": "Выполнить", "command": "Выполнить", "defaultButton": true }, - { "button": "Закрыть", "stdCommand": "Close" } + { "button": "Закрыть", "stdCommand": "Close", "representationInContextMenu": "None" } ]}, { "input": "Результат", "path": "Результат", "multiLine": true, "height": 8, "readOnly": true } ], diff --git a/tests/skills/cases/form-compile/groups.json b/tests/skills/cases/form-compile/groups.json index f5aa7256..f9ef6346 100644 --- a/tests/skills/cases/form-compile/groups.json +++ b/tests/skills/cases/form-compile/groups.json @@ -17,7 +17,7 @@ "title": "Группы", "elements": [ { "cmdBar": "КоманднаяПанель", "autofill": true }, - { "group": "horizontal", "name": "ГруппаШапка", "behavior": "usual", "showTitle": true, "title": "Шапка", "horizontalStretch": true, "groupHorizontalAlign": "Right", "throughAlign": "Use", "verticalAlign": "Top", "childItemsWidth": "Equal", "children": [ + { "group": "horizontal", "name": "ГруппаШапка", "behavior": "usual", "showTitle": true, "title": "Шапка", "horizontalStretch": true, "groupHorizontalAlign": "Right", "throughAlign": "Use", "verticalAlign": "Top", "childItemsWidth": "Equal", "horizontalSpacing": "None", "children": [ { "input": "Поле1", "path": "Поле1", "title": "Поле 1", "width": 20, "skipOnInput": true, "mask": "999-999" }, { "input": "Поле2", "path": "Поле2", "title": "Поле 2" }, { "labelField": "Метка", "path": "Поле1", "groupVerticalAlign": "Center" } diff --git a/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml index 9f024269..c1020baa 100644 --- a/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml @@ -36,6 +36,7 @@ diff --git a/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml index e41dfdbe..2c1dea03 100644 --- a/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml @@ -29,6 +29,7 @@ Top Use Equal + None diff --git a/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml index 90cc8133..6498daab 100644 --- a/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml @@ -21,6 +21,7 @@ None None 80 + false Add Delete diff --git a/tests/skills/cases/form-compile/table.json b/tests/skills/cases/form-compile/table.json index 3242ec12..3b35b2cb 100644 --- a/tests/skills/cases/form-compile/table.json +++ b/tests/skills/cases/form-compile/table.json @@ -16,7 +16,7 @@ "input": { "title": "Просмотр данных", "elements": [ - { "table": "Данные", "path": "Данные", "changeRowSet": true, "titleLocation": "top", "height": 80, "heightInTableRows": 5, "autofill": true, "multipleChoice": true, "searchOnInput": "Use", "markIncomplete": true, + { "table": "Данные", "path": "Данные", "changeRowSet": true, "titleLocation": "top", "height": 80, "heightInTableRows": 5, "autofill": true, "multipleChoice": true, "searchOnInput": "Use", "markIncomplete": true, "settingsNamedItemDetailedRepresentation": false, "viewStatusLocation": "None", "searchControlLocation": "None", "excludedCommands": ["Add", "Delete", "MoveUp", "MoveDown"], "commandBar": { "autofill": false, "children": [