Skip to content

Support compound (nested) design properties in MDL #668

@ako

Description

@ako

Summary

MDL designproperties: can only express flat design properties — a key with a single value (option/dropdown string, or toggle boolean). It cannot express a compound design property: one whose value is itself a set of sub-properties (e.g. Atlas's Spacing, which Studio Pro stores as compound:Spacing → {option:margin-top: 'L', option:margin-bottom: 'M', …}).

A compound property written in MDL is silently not emitted.

Scope (stack-wide, not backend-specific)

This isn't an MCP or file-backend bug — both are at parity. Adding support requires changes across the stack:

  1. MDL grammar/AST — syntax for nesting, e.g. designproperties: ['Spacing': ['margin-top': 'L', 'margin-bottom': 'M']] (ast.DesignPropertyEntryV3 is currently a flat key-value).
  2. SDK typesdk/pages.DesignPropertyValue{Key, ValueType, Option} is flat; needs a compound/nested variant (ValueType currently ∈ toggle/option/custom).
  3. File (MPR) backendsdk/mpr/writer_widgets.go serializeDesignProperties emits only Forms$Toggle/Option/Custom/DesignPropertyValue; needs Forms$CompoundDesignPropertyValue (confirm the exact $Type + structure with an on-disk BSON capture of a Studio-Pro-set compound property).
  4. MCP backendmdl/backend/mcp designPropertiesMap needs to emit the compound: object form (the pg_write_page shape is already known: "compound:Spacing": {"option:margin-top": "L"}, captured in mdl/backend/mcp/testdata/pg-page-contact-newedit-designprops.json).

Workaround (today)

Set compound design properties in Studio Pro directly, or use style: (raw CSS) / class: (Atlas utility classes).

Priority

Low/medium — flat properties cover most cases; compound (grouped Spacing, per-device settings) is used in richer Atlas theming. No regression: this has never worked through either backend.

Notes

  • Surfaced during the MCP page-design-property fix; the pg_read_page capture revealed the compound:/nested shape.
  • Known-limitation documented in the theme-styling skill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions