Repository navigation
fix: describe keeps an Accordion group's headerContent out of its body - #1565
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1326 (mirror of mendixlabs#1453). This is the prerequisite step of the proposal in #1564.
Symptom
An Accordion group has two widget slots,
headerContentandcontent. 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:The block form that keeps them apart couldn't run either:
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 pageand 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
extractObjectListItemkeeps each widget slot apart. The body slot prints as the item's children; every other non-empty slot prints as a<keyword> { … }block, reusingoutputChildSlots.content, else the first widget slot" is nowbodyItemSlotKey, called by both CREATE'sdefaultItemSlotKeyand describe, so the two can't disagree.validateWidgetTreeInpasses an item's mapping to its children. A slot the item declares is accepted; a misspelt one is still refused.Describe now prints:
Evidence
headercontentblock, 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.checkpasses, the result isheaderContent -> ['txtHead'],content -> ['txtBody'], andmx checkreportsThe app contains: 0 errors.mdl-examples/bug-tests/1453-describe-accordion-headercontent-slot.mdl. Finding recorded.make build && make test && make lint,make check-mdlandmake check-findingsall pass.Generated by Claude Code