Skip to content

feat(catalog): page and layout appearance, and the widgets of layouts (#1302) - #2012

Merged
ako merged 1 commit into
mainfrom
feature/1302-page-style-layout-widgets
Nov 7, 2026
Merged

ako merged 1 commit into
mainfrom
feature/1302-page-style-layout-widgets

Conversation

@ako

@ako ako commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Closes #1302 (mirror of mendixlabs#1311).

Problem

A Starlark rule "no inline styles" could not see:

  • the page's own Class/Style: pages() had no such fields;
  • any widget of a layout: widgets() returned no LAYOUT rows.

Those are the places whose styling reaches every page, so the rule missed the widest-reaching cases.

Change

  • Catalog (mdl/catalog)
    • pages_data and layouts_data gain Class, Style and DynamicClasses, read from the unit's Appearance in a full build.

    • buildLayouts writes a layout's widgets to widgets_data with ContainerType = 'LAYOUT'. They come from:

      • Content.Widgets;
      • a nested layout's Content.LayoutCall.Arguments;
      • a native layout's RightHeaderPlaceholder and SidebarWidgets.

      They go through the same walkWidget as page widgets. Their refs come with them, so a microflow that only a layout's button calls now has the layout as its caller.

    • Schema version 34.

  • Linter
    • pages() and layouts() gain class_name, style and dynamic_classes. These are added to fullFields, so reading one builds a full catalog.
    • The four Go rules that mapped every non-SNIPPET container to "page" now use widgetDocType, which gives layout for a layout.
    • NativePages() now also includes native layouts, so MPR012 skips them as it skips native pages.
  • Executor: update widgets still selects page and snippet widgets only. Writing to layouts through it would be a separate decision, and this PR only changes reads.
  • Docs: the lint-rules skill tables, the catalog tables reference and the internals schema; a CHANGELOG entry.

Evidence

  • Tests, each written before its fix and failing first:
    • TestLayoutWidgetsAreIndexed_Issue1302 is the issue's repro layout. It failed with "ctnLayoutBanner not indexed; widgets_data has map[]".
    • TestExtractLayoutWidgets_NestedAndNative.
    • TestPageAppearanceColumns_Issue1302 failed with "no such column: Class".
    • TestStarlarkSeesPageAndLayoutAppearance_Issue1302 failed with "page struct has no .class_name attribute".
    • TestAppearanceFieldsRequireFullCatalog.
    • TestReactUnsupportedWidgetRule_LayoutWidgets failed with both symptoms: the layout was reported as page, and the native layout was flagged.
    • TestUpdateWidgetsLeavesLayoutWidgetsAlone_Issue1302.
  • FactoryManagement (11.16), main against this branch, after refresh catalog full force:
    • Layout widgets: 0 → 209, across all 46 layouts (41 web, 5 native). No layout widget points at a parent that isn't indexed. Atlas_Default's tree is as Studio Pro shows it, down to its image at depth 4.
    • Page and layout appearance: 18 pages and 27 layouts have a class, and 2 pages an inline style.
    • 37 refs now have SourceType = 'LAYOUT'.
    • Lint output is byte-identical, both with the 28 built-in rules and with the 31 bundled Starlark rules. The new rows add no findings.
  • make ci-local passes with toolchain go1.27.3. Two caveats:
    • The mdl/executor compile was OOM-killed under the parallel run, as before. It passes on its own with go test -p 1.
    • check-skill-pack-js needs node, which isn't installed locally.

Not covered: snippets have no Appearance of their own (Forms$Snippet has none in the metamodel), so snippets() has nothing to add.

🤖 Generated with Claude Code

…#1302)

A Starlark rule "no inline styles" could not see a page's own Class/Style
or any widget of a layout, the two places whose styling reaches every page
(mendixlabs#1311).

- pages and layouts gain Class, Style and DynamicClasses (full build), and
  pages()/layouts() expose class_name, style and dynamic_classes; reading
  one raises a rule to the full catalog.
- widgets gains a layout's widgets (ContainerType LAYOUT): Content.Widgets,
  a nested layout's call arguments, a native layout's header placeholder
  and sidebar. Their refs make a layout the caller of a microflow only its
  button calls.
- Built-in rules report a layout finding against the layout, and the
  React-client rule skips native layouts as it skips native pages.
- UPDATE WIDGETS keeps selecting page and snippet widgets only.

Schema version 34.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[up#1311] Catalog: the page's own Class/Style and the widgets of layouts are missing (widgets() covers pages and snippets only)

1 participant