Skip to content

fix: describe keeps an Accordion group's headerContent out of its body - #1565

Merged
ako merged 1 commit into
mainfrom
fix/1453-describe-item-slots
Oct 22, 2026
Merged

ako merged 1 commit into
mainfrom
fix/1453-describe-item-slots

Conversation

@ako

@ako ako commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Refs #1326 (mirror of mendixlabs#1453). This is the prerequisite step of the proposal in #1564.

Symptom

An Accordion group has two widget slots, headerContent and content. Describe printed both as the group's body, so regenerating the page from the description moved the header widget into the body. Measured on a fresh blank Mendix 11.13.0 app:

stored:       headerContent -> [txtHead], content -> [txtBody]
regenerated:  content -> [txtHead, txtBody]

The block form that keeps them apart couldn't run either:

✗ page H.P: `headercontent` is not a widget in this project [MDL-WIDGET25]

The builder does accept that block (its item-slot pass routes it). The checker, though, resolved no parent definition for a child of an object-list item, so the item's own slot keyword fell through to "not a widget".

Updating the existing page from the description reports Unchanged page and hides the loss. Only a run against a fresh app shows it, and that is the case that matters: regenerating a page from describe output.

Fix

  • Describe: extractObjectListItem keeps each widget slot apart. The body slot prints as the item's children; every other non-empty slot prints as a <keyword> { … } block, reusing outputChildSlots.
  • One body rule: "content, else the first widget slot" is now bodyItemSlotKey, called by both CREATE's defaultItemSlotKey and describe, so the two can't disagree.
  • Check: validateWidgetTreeIn passes an item's mapping to its children. A slot the item declares is accepted; a misspelt one is still refused.

Describe now prints:

group (headerRenderMode: 'custom', …) {
  headercontent {
    dynamictext txtHead (Content: 'Header')
  }
  dynamictext txtBody (Content: 'Body')
}

Evidence

  • Control: before the fix, the new tests fail with the body holding both widgets, with no headercontent block, and with MDL-WIDGET25 at check. The misspelt-block test passes before and after, so the check wasn't simply switched off. The accept test fails on any error-severity violation, not just rule 25/26.
  • Real run (fixed build): describe the page, then exec the description on a fresh app. check passes, the result is headerContent -> ['txtHead'], content -> ['txtBody'], and mx check reports The app contains: 0 errors.
  • Regression script: mdl-examples/bug-tests/1453-describe-accordion-headercontent-slot.mdl. Finding recorded.
  • make build && make test && make lint, make check-mdl and make check-findings all pass.

Generated by Claude Code

DESCRIBE folded every widget slot of an object-list item into the item's
body, so an Accordion group's headerContent widgets were printed beside
its content widgets, and a page regenerated from the description stored
them in content. Measured on a blank 11.13.0 app:

  stored:       headerContent -> [txtHead], content -> [txtBody]
  regenerated:  content -> [txtHead, txtBody]

The block form that keeps them apart could not run either:
`headercontent { … }` inside a group failed check with MDL-WIDGET25 "not
a widget in this project". The item builder routes that block; the
widget-kind validator resolved no parent for a child of an item, so the
item's own slot keyword fell through to the unknown-widget error.

- describe keeps each slot apart and prints the body slot as the item's
  children, every other non-empty slot as `<keyword> { … }`;
- the body choice (content, else the first widget slot) is one function,
  bodyItemSlotKey, called by both CREATE's defaultItemSlotKey and describe;
- the validator passes an item's mapping to its children, so a slot the
  item declares is accepted and a misspelt one is still refused.

Control: before the fix the new tests fail with the body holding both
widgets and MDL-WIDGET25; the misspelt-block control passes before and
after. Fixed, the describe -> fresh-app round trip stores txtHead in
headerContent and txtBody in content, and mx check reports 0 errors.

Prerequisite of PROPOSAL_alter_object_list_item_address.md (#1564).
Refs #1326

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019httGxDh8UXt1Zoyh3Gh52
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.

2 participants