mxcli version: v0.24.0 and main (f18c3077); Mendix 11.12.1, MPR v2, macOS
Summary
A navigationtree can draw its items from either a navigation profile (Forms$NavigationSource) or a menu document (Forms$MenuDocumentSource). mxcli supports only the profile. A menu-document source is lost in three ways, and none of them produces a diagnostic:
describe drops it. Atlas_Core.Tablet_Sidebar's tree reads Atlas_Core.Tablet_Menu, and describe layout prints just navigationtree navigationTree3.
exec replaces it. Executing that output writes a Forms$NavigationSource with profile Responsive, so the tablet layout now shows the desktop menu.
Menu: is accepted and ignored. navigationtree nav (Menu: MyFirstModule.Side_Menu) passes check and exec, and is stored as Profile: 'Responsive'.
mx check reports 0 errors in every case.
Repro (blank project)
Round trip of a stock layout:
mxcli describe layout Atlas_Core.Tablet_Sidebar -p app.mpr \
| sed 's/Atlas_Core.Tablet_Sidebar/MyFirstModule.Tablet_Copy/' > tcopy.mdl
mxcli exec tcopy.mdl -p app.mpr
mxcli describe layout MyFirstModule.Tablet_Copy -p app.mpr | grep navigationtree
# navigationtree navigationTree3 (Profile: 'Responsive')
mxcli bson dump -p app.mpr --type layout --object Atlas_Core.Tablet_Sidebar # MenuSource: Forms$MenuDocumentSource, Menu: Atlas_Core.Tablet_Menu
mxcli bson dump -p app.mpr --type layout --object MyFirstModule.Tablet_Copy # MenuSource: Forms$NavigationSource, NavigationProfile: Responsive
Writing the source directly:
create or modify menu MyFirstModule.Side_Menu (
menu item 'Home' page MyFirstModule.Home_Web;
);
create layout MyFirstModule.Side_Layout (layouttype: 'Responsive') {
scrollcontainer layoutContainer {
region left (Size: 232, SizeMode: 'Pixels') {
navigationtree navSidebar (Menu: MyFirstModule.Side_Menu)
}
region center { placeholder Main }
}
}
check → Check passed!; exec → Created layout; describe → navigationtree navSidebar (Profile: 'Responsive').
Eight other stock layouts carry a Forms$MenuDocumentSource: Phone_Sidebar's tree, and the SimpleMenuBar of Phone_Default, Phone_BottomBar, Tablet_Default, Tablet_BottomBar and the three Tablet_Split_* layouts. describe already flags SimpleMenuBar as not re-executable, so only the tree loses its source silently.
Cause
buildNavigationTreeV3 (mdl/executor/cmd_pages_builder_v3.go) reads only Profile, so any other property is ignored.
widgetToGen (mdl/backend/modelsdk/widget_write.go) always writes a NavigationSource and defaults an empty profile to "Responsive".
cmd_pages_describe_parse.go reads MenuSource.NavigationProfile only, so a MenuDocumentSource comes out empty.
MenuBar has the same three paths.
Suggested fix
- Add
Menu: Module.MenuName to navigationtree and menubar, written as Forms$MenuDocumentSource (Menu by name, as in the stock layouts).
describe prints Menu: for such a tree, so the round trip keeps it.
Menu: together with Profile: is an error.
check --references resolves the menu document.
Happy to open the PR.
mxcli version: v0.24.0 and main (
f18c3077); Mendix 11.12.1, MPR v2, macOSSummary
A
navigationtreecan draw its items from either a navigation profile (Forms$NavigationSource) or a menu document (Forms$MenuDocumentSource). mxcli supports only the profile. A menu-document source is lost in three ways, and none of them produces a diagnostic:describedrops it.Atlas_Core.Tablet_Sidebar's tree readsAtlas_Core.Tablet_Menu, anddescribe layoutprints justnavigationtree navigationTree3.execreplaces it. Executing that output writes aForms$NavigationSourcewith profileResponsive, so the tablet layout now shows the desktop menu.Menu:is accepted and ignored.navigationtree nav (Menu: MyFirstModule.Side_Menu)passescheckandexec, and is stored asProfile: 'Responsive'.mx checkreports 0 errors in every case.Repro (blank project)
Round trip of a stock layout:
Writing the source directly:
check→Check passed!;exec→Created layout;describe→navigationtree navSidebar (Profile: 'Responsive').Eight other stock layouts carry a
Forms$MenuDocumentSource:Phone_Sidebar's tree, and theSimpleMenuBarofPhone_Default,Phone_BottomBar,Tablet_Default,Tablet_BottomBarand the threeTablet_Split_*layouts.describealready flagsSimpleMenuBaras not re-executable, so only the tree loses its source silently.Cause
buildNavigationTreeV3(mdl/executor/cmd_pages_builder_v3.go) reads onlyProfile, so any other property is ignored.widgetToGen(mdl/backend/modelsdk/widget_write.go) always writes aNavigationSourceand defaults an empty profile to"Responsive".cmd_pages_describe_parse.goreadsMenuSource.NavigationProfileonly, so aMenuDocumentSourcecomes out empty.MenuBarhas the same three paths.Suggested fix
Menu: Module.MenuNametonavigationtreeandmenubar, written asForms$MenuDocumentSource(Menuby name, as in the stock layouts).describeprintsMenu:for such a tree, so the round trip keeps it.Menu:together withProfile:is an error.check --referencesresolves the menu document.Happy to open the PR.