[network/neochat] src/spaces: add empty space placeholder

Tobias Fella <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 4a7bd3ab93bf3fe553c4db0349f88eb644047cd0 by Tobias Fella, on behalf of Avani M.
Committed on 17/08/2026 at 19:48.
Pushed by tfella into branch 'master'.

add empty space placeholder

M  +28   -19   src/spaces/SpaceHomePage.qml

https://invent.kde.org/network/neochat/-/commit/4a7bd3ab93bf3fe553c4db0349f88eb644047cd0

diff --git a/src/spaces/SpaceHomePage.qml b/src/spaces/SpaceHomePage.qml
index ebfa99d1b..bfb3d40ff 100644
--- a/src/spaces/SpaceHomePage.qml
+++ b/src/spaces/SpaceHomePage.qml
@@ -164,36 +164,45 @@ ColumnLayout {
     Kirigami.Separator {
         Layout.fillWidth: true
     }
-    QQC2.ScrollView {
-        id: hierarchyScrollView
+    Item {
         Layout.fillWidth: true
         Layout.fillHeight: true
         visible: !spaceChildrenModel.loading
 
-        TreeView {
-            id: spaceTree
-            columnWidthProvider: function (column) {
-                return spaceTree.width;
-            }
+        QQC2.ScrollView {
+            id: hierarchyScrollView
+            anchors.fill: parent
+            TreeView {
+                id: spaceTree
+                columnWidthProvider: function (column) {
+                    return spaceTree.width;
+                }
+
+                clip: true
 
-            clip: true
+                model: SpaceChildSortFilterModel {
+                    id: spaceChildSortFilterModel
+                    sourceModel: SpaceChildrenModel {
+                        id: spaceChildrenModel
+                        space: root.room
+                    }
+                }
 
-            model: SpaceChildSortFilterModel {
-                id: spaceChildSortFilterModel
-                sourceModel: SpaceChildrenModel {
-                    id: spaceChildrenModel
-                    space: root.room
+                delegate: SpaceHierarchyDelegate {
+                    onCreateRoom: _private.createRoom(roomId)
                 }
             }
 
-            delegate: SpaceHierarchyDelegate {
-                onCreateRoom: _private.createRoom(roomId)
+            background: Rectangle {
+                color: Kirigami.Theme.backgroundColor
+                Kirigami.Theme.colorSet: Kirigami.Theme.View
             }
         }
-
-        background: Rectangle {
-            color: Kirigami.Theme.backgroundColor
-            Kirigami.Theme.colorSet: Kirigami.Theme.View
+        Kirigami.PlaceholderMessage {
+            anchors.centerIn: parent
+            visible: spaceTree.rows === 0 && spaceChildSortFilterModel.filterText.length === 0
+            text: i18nc("@title", "This Space is empty")
+            explanation: i18nc("@info", "Add rooms to this Space to get started.")
         }
     }
     QQC2.Control {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.