Parent: #529 (unified schema registry, revised phasing)
Milestone: v0.10.0
Goal
Support Type: "Object" + IsList: true properties in pluggable widget templates,
expressed in MDL as named child blocks. Headline use case is pluggable DataGrid
columns; same engine work covers Accordion groups, PopupMenu items, AreaChart
series, Maps markers.
Acceptance fixtures
mdl-examples/doctype-tests/32-pluggable-widget-object-lists-v010.test.mdl
(currently fails parse — passes once this issue lands)
mdl-examples/doctype-tests/31-pluggable-datagrid-gallery-v010-examples.mdl
(already parses; Phase 1 makes the BSON output correct for pluggable DataGrid)
Layered work
Layer 1 — .def.json format extension (additive)
Extend the WidgetDefinition Go struct + JSON serialization to include an
objectLists field alongside propertyMappings and childSlots:
{
"objectLists": [
{
"propertyKey": "groups",
"mdlContainer": "GROUP",
"itemProperties": [
{ "propertyKey": "headerText", "operation": "texttemplate" },
{ "propertyKey": "headerContent", "mdlContainer": "HEADERCONTENT", "operation": "widgets" },
{ "propertyKey": "content", "mdlContainer": "CONTENT", "operation": "widgets" }
]
}
]
}
Existing .def.json files stay valid (no objectLists field = behaves as today).
Layer 2 — mxcli widget init MPK XML parser
Extend cmd/mxcli/cmd_widget.go to recognize <property type="object" isList="true">
in widget XML and emit the objectLists block, including recursive sub-property
trees (the inner <property> elements inside <properties> / <propertyGroup>).
Validation: run mxcli widget init against a project containing Accordion, verify
the generated .mxcli/widgets/accordion.def.json includes a groups entry with
the expected sub-properties (headerText, headerContent, content, etc.).
Layer 3 — Grammar / visitor / executor
- ANTLR grammar additions in
mdl/grammar/MDLParser.g4: object-list child block
rule that mirrors childSlot syntax (<keyword> <name> ( <props> ) { <widgets> })
- Visitor in
mdl/visitor/visitor_widgets.go: build AST nodes for object-list
child blocks, look up the parent widget's objectLists to resolve keyword →
property key mapping
- Executor in
mdl/executor/cmd_pages_builder_v3_widgets.go: serialize object-list
items to BSON via the existing WidgetEngine API (extend with object-list
builders)
Acceptance criteria
Dependencies / blockers
None — this is the first phase. Layer 1 + 2 + 3 can land as one PR or as three
sequential PRs (Layer 1 + 2 first, Layer 3 second).
🤖 Generated with Claude Code
Parent: #529 (unified schema registry, revised phasing)
Milestone: v0.10.0
Goal
Support
Type: "Object" + IsList: trueproperties in pluggable widget templates,expressed in MDL as named child blocks. Headline use case is pluggable DataGrid
columns; same engine work covers Accordiongroups, PopupMenu items, AreaChartseries, Mapsmarkers.Acceptance fixtures
mdl-examples/doctype-tests/32-pluggable-widget-object-lists-v010.test.mdl(currently fails parse — passes once this issue lands)
mdl-examples/doctype-tests/31-pluggable-datagrid-gallery-v010-examples.mdl(already parses; Phase 1 makes the BSON output correct for pluggable DataGrid)
Layered work
Layer 1 —
.def.jsonformat extension (additive)Extend the
WidgetDefinitionGo struct + JSON serialization to include anobjectListsfield alongsidepropertyMappingsandchildSlots:{ "objectLists": [ { "propertyKey": "groups", "mdlContainer": "GROUP", "itemProperties": [ { "propertyKey": "headerText", "operation": "texttemplate" }, { "propertyKey": "headerContent", "mdlContainer": "HEADERCONTENT", "operation": "widgets" }, { "propertyKey": "content", "mdlContainer": "CONTENT", "operation": "widgets" } ] } ] }Existing
.def.jsonfiles stay valid (noobjectListsfield = behaves as today).Layer 2 —
mxcli widget initMPK XML parserExtend
cmd/mxcli/cmd_widget.goto recognize<property type="object" isList="true">in widget XML and emit the
objectListsblock, including recursive sub-propertytrees (the inner
<property>elements inside<properties>/<propertyGroup>).Validation: run
mxcli widget initagainst a project containing Accordion, verifythe generated
.mxcli/widgets/accordion.def.jsonincludes agroupsentry withthe expected sub-properties (headerText, headerContent, content, etc.).
Layer 3 — Grammar / visitor / executor
mdl/grammar/MDLParser.g4: object-list child blockrule that mirrors
childSlotsyntax (<keyword> <name> ( <props> ) { <widgets> })mdl/visitor/visitor_widgets.go: build AST nodes for object-listchild blocks, look up the parent widget's
objectListsto resolve keyword →property key mapping
mdl/executor/cmd_pages_builder_v3_widgets.go: serialize object-listitems to BSON via the existing
WidgetEngineAPI (extend with object-listbuilders)
Acceptance criteria
.def.jsonschema extended; existing files unchanged in shapemxcli widget initextracts object-list properties from MPK XMLgroupssyntax parses, executes, opens cleanly in Studio Pro 11.xbasicItemsandcustomItemswork end-to-endseriesworks end-to-endmarkersanddynamicMarkerswork end-to-end32-pluggable-widget-object-lists-v010.test.mdlrenamed to.mdl(no longer needs to skip parse) and passesmxcli checkDependencies / blockers
None — this is the first phase. Layer 1 + 2 + 3 can land as one PR or as three
sequential PRs (Layer 1 + 2 first, Layer 3 second).
🤖 Generated with Claude Code