From 78c6db09b54bf31e200c132e7913ce3d9e3464be Mon Sep 17 00:00:00 2001 From: Kaustuv Pokharel Date: Mon, 6 Oct 2025 17:27:48 -0400 Subject: [PATCH 1/7] WIP: Diagnosing the space probkem with the empty delegate state component --- .../components/MMListMultiselectDrawer.qml | 21 +++++++++++++------ .../editors/MMFormValueRelationEditor.qml | 6 +++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/qml/components/MMListMultiselectDrawer.qml b/app/qml/components/MMListMultiselectDrawer.qml index 25e7ad656..55dacd916 100644 --- a/app/qml/components/MMListMultiselectDrawer.qml +++ b/app/qml/components/MMListMultiselectDrawer.qml @@ -37,7 +37,11 @@ MMDrawer { drawerContent: Item { width: parent.width - height: showFullScreen ? root.drawerContentAvailableHeight : contentLayout.height + height: { + if ( root.showFullScreen ) return root.drawerContentAvailableHeight + if ( listViewComponent.count === 0 ) return emptyStateDelegateLoader.height + return listViewComponent.height + } Column { id: contentLayout @@ -64,21 +68,26 @@ MMDrawer { MMListSpacer { id: searchBarSpacer; height: __style.spacing20; visible: root.withSearch } Item { + id: featureList width: parent.width height: listViewComponent.count === 0 ? emptyStateDelegateLoader.height : listViewComponent.height - + Rectangle + { + anchors.fill:parent + color: "green" + } MMScrollView { width: parent.width height: Math.min( contentHeight, root.drawerContentAvailableHeight - internal.searchBarVerticalSpace ) - - enabled: contentHeight > height + anchors.top: parent.top + visible: listViewComponent.count === 0 Loader { id: emptyStateDelegateLoader visible: listViewComponent.count === 0 - width: parent.width + anchors.top: parent.top } } @@ -87,7 +96,7 @@ MMDrawer { width: parent.width height: Math.min( contentHeight, root.drawerContentAvailableHeight - internal.searchBarVerticalSpace ) - + visible: count > 0 interactive: contentHeight > height clip: true diff --git a/app/qml/form/editors/MMFormValueRelationEditor.qml b/app/qml/form/editors/MMFormValueRelationEditor.qml index 3d40e50ff..7d90a3365 100644 --- a/app/qml/form/editors/MMFormValueRelationEditor.qml +++ b/app/qml/form/editors/MMFormValueRelationEditor.qml @@ -69,9 +69,13 @@ MMFormComboboxBaseEditor { dropdownLoader.sourceComponent: Component { MMComponents.MMListMultiselectDrawer { - drawerHeader.title: root._fieldTitle + //Incase when list is empty (ex: no relation value fields) + emptyStateDelegate: MMMessage { + description: qsTr( "No items" ) + } + multiSelect: internal.allowMultivalue withSearch: vrModel.count > 5 showFullScreen: multiSelect || withSearch From f18661a437dc30350d6f704891b1e74fe29079a5 Mon Sep 17 00:00:00 2001 From: Kaustuv Pokharel Date: Tue, 7 Oct 2025 10:52:14 -0400 Subject: [PATCH 2/7] changed coomponent to text --- app/qml/form/editors/MMFormValueRelationEditor.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/qml/form/editors/MMFormValueRelationEditor.qml b/app/qml/form/editors/MMFormValueRelationEditor.qml index 7d90a3365..3e769c7aa 100644 --- a/app/qml/form/editors/MMFormValueRelationEditor.qml +++ b/app/qml/form/editors/MMFormValueRelationEditor.qml @@ -72,8 +72,8 @@ MMFormComboboxBaseEditor { drawerHeader.title: root._fieldTitle //Incase when list is empty (ex: no relation value fields) - emptyStateDelegate: MMMessage { - description: qsTr( "No items" ) + emptyStateDelegate: MMComponents.MMText { + text: qsTr( "No items" ) } multiSelect: internal.allowMultivalue From 446fcf4f9dc1294fa1688ce591e884c8c3431a85 Mon Sep 17 00:00:00 2001 From: Kaustuv Pokharel Date: Wed, 8 Oct 2025 00:04:15 -0400 Subject: [PATCH 3/7] fixed the position of -no items- text --- app/qml/components/MMListMultiselectDrawer.qml | 14 ++++---------- app/qml/form/editors/MMFormValueRelationEditor.qml | 2 ++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/qml/components/MMListMultiselectDrawer.qml b/app/qml/components/MMListMultiselectDrawer.qml index 55dacd916..0c244d20c 100644 --- a/app/qml/components/MMListMultiselectDrawer.qml +++ b/app/qml/components/MMListMultiselectDrawer.qml @@ -33,7 +33,7 @@ MMDrawer { interactive: !listViewComponent.interactive - drawerBottomMargin: 0 + drawerBottomMargin: __style.margin20 + __style.safeAreaBottom drawerContent: Item { width: parent.width @@ -71,23 +71,17 @@ MMDrawer { id: featureList width: parent.width height: listViewComponent.count === 0 ? emptyStateDelegateLoader.height : listViewComponent.height - Rectangle - { - anchors.fill:parent - color: "green" - } + MMScrollView { width: parent.width height: Math.min( contentHeight, root.drawerContentAvailableHeight - internal.searchBarVerticalSpace ) - anchors.top: parent.top - visible: listViewComponent.count === 0 + enabled: contentHeight > height Loader { id: emptyStateDelegateLoader visible: listViewComponent.count === 0 - width: parent.width - anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter } } diff --git a/app/qml/form/editors/MMFormValueRelationEditor.qml b/app/qml/form/editors/MMFormValueRelationEditor.qml index 3e769c7aa..e99af88ff 100644 --- a/app/qml/form/editors/MMFormValueRelationEditor.qml +++ b/app/qml/form/editors/MMFormValueRelationEditor.qml @@ -74,6 +74,8 @@ MMFormComboboxBaseEditor { //Incase when list is empty (ex: no relation value fields) emptyStateDelegate: MMComponents.MMText { text: qsTr( "No items" ) + topPadding: __style.margin20 + bottomPadding: __style.margin20 } multiSelect: internal.allowMultivalue From 09b0c8f5d7ee6f1ca08da57507d0b07ba07aa866 Mon Sep 17 00:00:00 2001 From: Kaustuv Pokharel Date: Fri, 10 Oct 2025 03:20:44 -0400 Subject: [PATCH 4/7] suggested changes --- app/qml/components/MMListMultiselectDrawer.qml | 9 +++------ .../form/editors/MMFormValueRelationEditor.qml | 16 +++++++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/qml/components/MMListMultiselectDrawer.qml b/app/qml/components/MMListMultiselectDrawer.qml index 0c244d20c..effe50df6 100644 --- a/app/qml/components/MMListMultiselectDrawer.qml +++ b/app/qml/components/MMListMultiselectDrawer.qml @@ -37,11 +37,7 @@ MMDrawer { drawerContent: Item { width: parent.width - height: { - if ( root.showFullScreen ) return root.drawerContentAvailableHeight - if ( listViewComponent.count === 0 ) return emptyStateDelegateLoader.height - return listViewComponent.height - } + height: showFullScreen ? root.drawerContentAvailableHeight : contentLayout.height Column { id: contentLayout @@ -81,7 +77,8 @@ MMDrawer { id: emptyStateDelegateLoader visible: listViewComponent.count === 0 - anchors.horizontalCenter: parent.horizontalCenter + + width: parent.width } } diff --git a/app/qml/form/editors/MMFormValueRelationEditor.qml b/app/qml/form/editors/MMFormValueRelationEditor.qml index e99af88ff..d8cba72c1 100644 --- a/app/qml/form/editors/MMFormValueRelationEditor.qml +++ b/app/qml/form/editors/MMFormValueRelationEditor.qml @@ -71,11 +71,17 @@ MMFormComboboxBaseEditor { MMComponents.MMListMultiselectDrawer { drawerHeader.title: root._fieldTitle - //Incase when list is empty (ex: no relation value fields) - emptyStateDelegate: MMComponents.MMText { - text: qsTr( "No items" ) - topPadding: __style.margin20 - bottomPadding: __style.margin20 + emptyStateDelegate: Item { + width: parent.width + height: noItemsText.implicitHeight + anchors.centerIn: parent + + MMComponents.MMText { + id: noItemsText + text: qsTr( "No items" ) + anchors.centerIn: parent + topPadding: __style.margin20 + } } multiSelect: internal.allowMultivalue From 0eff715dcf34b71ba0961327240108b4bbba645d Mon Sep 17 00:00:00 2001 From: Kaustuv Pokharel Date: Fri, 10 Oct 2025 03:40:54 -0400 Subject: [PATCH 5/7] fixed drawerBottomMargin --- app/qml/components/MMListMultiselectDrawer.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/qml/components/MMListMultiselectDrawer.qml b/app/qml/components/MMListMultiselectDrawer.qml index effe50df6..e2bd2c0b4 100644 --- a/app/qml/components/MMListMultiselectDrawer.qml +++ b/app/qml/components/MMListMultiselectDrawer.qml @@ -33,7 +33,9 @@ MMDrawer { interactive: !listViewComponent.interactive - drawerBottomMargin: __style.margin20 + __style.safeAreaBottom + drawerBottomMargin: listViewComponent.count === 0 + ? (__style.margin20 + __style.safeAreaBottom) + : 0 drawerContent: Item { width: parent.width From 4272b2029a584f4d0e2681bdb45db5574b4614e0 Mon Sep 17 00:00:00 2001 From: Gabriel Bolbotina Date: Fri, 5 Dec 2025 15:46:00 +0200 Subject: [PATCH 6/7] Added message if the value map is empty --- app/qml/form/editors/MMFormValueMapEditor.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/qml/form/editors/MMFormValueMapEditor.qml b/app/qml/form/editors/MMFormValueMapEditor.qml index ecb3531d0..8b85c1523 100644 --- a/app/qml/form/editors/MMFormValueMapEditor.qml +++ b/app/qml/form/editors/MMFormValueMapEditor.qml @@ -85,6 +85,19 @@ MMFormComboboxBaseEditor { drawerHeader.title: root._fieldTitle + emptyStateDelegate: Item { + width: parent.width + height: noItemsText.implicitHeight + anchors.centerIn: parent + + MMComponents.MMText { + id: noItemsText + text: qsTr( "No items" ) + anchors.centerIn: parent + topPadding: __style.margin20 + } + } + list.model: listModel selected: root.preselectedItems From cea5413544cb675148904378f8da8ff4bd231bb0 Mon Sep 17 00:00:00 2001 From: Gabriel Bolbotina Date: Tue, 16 Dec 2025 12:25:12 +0200 Subject: [PATCH 7/7] Implemented code review findings --- app/qml/components/MMListMultiselectDrawer.qml | 1 - app/qml/form/editors/MMFormValueMapEditor.qml | 6 ++---- app/qml/form/editors/MMFormValueRelationEditor.qml | 6 ++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/qml/components/MMListMultiselectDrawer.qml b/app/qml/components/MMListMultiselectDrawer.qml index e2bd2c0b4..b94ee4d64 100644 --- a/app/qml/components/MMListMultiselectDrawer.qml +++ b/app/qml/components/MMListMultiselectDrawer.qml @@ -66,7 +66,6 @@ MMDrawer { MMListSpacer { id: searchBarSpacer; height: __style.spacing20; visible: root.withSearch } Item { - id: featureList width: parent.width height: listViewComponent.count === 0 ? emptyStateDelegateLoader.height : listViewComponent.height diff --git a/app/qml/form/editors/MMFormValueMapEditor.qml b/app/qml/form/editors/MMFormValueMapEditor.qml index 8b85c1523..effcbedb9 100644 --- a/app/qml/form/editors/MMFormValueMapEditor.qml +++ b/app/qml/form/editors/MMFormValueMapEditor.qml @@ -87,14 +87,12 @@ MMFormComboboxBaseEditor { emptyStateDelegate: Item { width: parent.width - height: noItemsText.implicitHeight - anchors.centerIn: parent - + height: noItemsText.implicitHeight + __style.margin40 + MMComponents.MMText { id: noItemsText text: qsTr( "No items" ) anchors.centerIn: parent - topPadding: __style.margin20 } } diff --git a/app/qml/form/editors/MMFormValueRelationEditor.qml b/app/qml/form/editors/MMFormValueRelationEditor.qml index d8cba72c1..ae4016be2 100644 --- a/app/qml/form/editors/MMFormValueRelationEditor.qml +++ b/app/qml/form/editors/MMFormValueRelationEditor.qml @@ -73,14 +73,12 @@ MMFormComboboxBaseEditor { emptyStateDelegate: Item { width: parent.width - height: noItemsText.implicitHeight - anchors.centerIn: parent - + height: noItemsText.implicitHeight + __style.margin40 + MMComponents.MMText { id: noItemsText text: qsTr( "No items" ) anchors.centerIn: parent - topPadding: __style.margin20 } }