Skip to content

fix: ALTER PAGE/SNIPPET SET RenderMode on a dynamic text - #1

Open
MendixMau wants to merge 3 commits into
mainfrom
fix/alter-page-set-rendermode
Open

MendixMau wants to merge 3 commits into
mainfrom
fix/alter-page-set-rendermode

Conversation

@MendixMau

@MendixMau MendixMau commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Upstream issue: to be filed on mendixlabs/mxcli (CONTRIBUTING step 1). Draft and package in MendixMau/mxcli-project-toolkit → bug-logs/pending-github-issues/bug141-*.

What does it do?

ALTER PAGE / ALTER SNIPPET can now set RenderMode on a dynamic text:

alter page Mod.Page { set RenderMode = H2 on txtTitle };

CREATE PAGE already wrote this property, and the MCP backend's mutator already set it. The MPR backend's fixed property list in setRawWidgetPropertyMut did not include it, so the statement fell through to the pluggable-widget setter and failed. The new case:

  • applies only to a dynamic text (Forms$DynamicText); any other widget gets an error naming it
  • accepts Text, Paragraph and H1–H6 in any casing, and stores the canonical spelling
  • rejects anything else with invalid RenderMode "H7" for dynamic text "txtTitle": expected one of Text, Paragraph, H1, H2, H3, H4, H5, H6

Testing

  • New unit tests in mdl/backend/pagemutator/dynamictext_rendermode_test.go. They fail on main (31eee45) and pass with the fix; I checked this by swapping the original mutator.go back in.
  • Bug-test mdl-examples/bug-tests/alter-page-set-rendermode-dynamictext.mdl covers a page and a snippet.
  • make build, make test and make lint pass.

Mendix validation

Mendix 11.14.0, on a copy of a real project:

  • set RenderMode = H2 on an existing dynamic text printed Altered page.
  • describe page shows RenderMode: H2.
  • mx check reports 0 errors.
  • One .mxunit changed.

Docs

  • Skill alter-page
  • docs-site alter-page.md
  • MDL_QUICK_REFERENCE.md
  • mxcli syntax page.alter
  • A finding in .claude/skills/fix-issue/findings/mdl-backend.jsonl

Agentic Code Testing

  • Tested with Claude Code in dev container
  • Claude can generate correct MDL for this feature
  • Skills updated (if applicable)
  • error messages are helpful for debugging

Out of scope

  • set Content / ContentParams on a dynamic text (grammar-level)
  • RenderMode on a container
  • RenderType on a button

🤖 Generated with Claude Code

https://claude.ai/code/session_013uU1FnquwBoB43skj34Xh1

`alter page P { set RenderMode = H1 on <dynamictext> }` was refused
("property \"RenderMode\" not found (widget has no pluggable Object)",
now worded as "not a property of this built-in widget … use alter
styling"), although CREATE PAGE and REPLACE accept RenderMode on a
dynamictext. setRawWidgetPropertyMut had no case for it, so it fell
through to the pluggable-property setter.

Add a RenderMode case dispatched on the stored $Type (Forms$DynamicText):
the value is validated case-insensitively against Text, Paragraph and
H1-H6 and written in its canonical spelling; anything else is refused
with the accepted list, leaving the document untouched. Other widgets
keep the previous path. `check -p` picks this up for free, since it
dry-runs the same setter.

Verified on a copy of a Mendix 11.14.0 app: exec -> describe shows
RenderMode: H2 -> mx check 0 errors.

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