From a60d6c4a601aca597c06b30b919d68d11340b4a5 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 20 Feb 2026 16:40:55 -0500 Subject: [PATCH] Add report buttons to spaces This allows you to report harmful spaces that you already joined in, similar to the current UX for rooms. Note that you can't report subspaces or rooms within said spaces yet, that requires hover actions (or ideally a context menu) that don't exist yet. See #707 --- src/rooms/SpaceListContextMenu.qml | 22 ++++++++++++++++++++++ src/spaces/SpaceHomePage.qml | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/rooms/SpaceListContextMenu.qml b/src/rooms/SpaceListContextMenu.qml index 71d96bba2..02afe3145 100644 --- a/src/rooms/SpaceListContextMenu.qml +++ b/src/rooms/SpaceListContextMenu.qml @@ -81,6 +81,28 @@ KirigamiComponents.ConvergentContextMenu { separator: true } + Kirigami.Action { + text: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report…") + icon.name: "dialog-warning-symbolic" + visible: root.connection.supportsMatrixSpecVersion("v1.13") + onTriggered: { + let dialog = (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReasonDialog'), { + title: i18nc("@title:dialog", "Report Space"), + placeholder: i18nc("@info:placeholder", "Optionally give a reason for reporting this space"), + icon: "dialog-warning-symbolic", + actionText: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report"), + reporting: true, + connection: root.connection, + }, { + title: i18nc("@title", "Report Space"), + width: Kirigami.Units.gridUnit * 25 + }) as ReasonDialog; + dialog.accepted.connect(reason => { + root.room.report(reason); + }); + } + } + QQC2.Action { text: i18nc("'Space' is a matrix space", "Leave Space…") icon.name: "go-previous" diff --git a/src/spaces/SpaceHomePage.qml b/src/spaces/SpaceHomePage.qml index 2d1f8a0e9..027b148e1 100644 --- a/src/spaces/SpaceHomePage.qml +++ b/src/spaces/SpaceHomePage.qml @@ -105,6 +105,27 @@ ColumnLayout { Item { Layout.fillWidth: true } + QQC2.Button { + text: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report…") + icon.name: "dialog-warning-symbolic" + visible: root.connection.supportsMatrixSpecVersion("v1.13") + onClicked: { + let dialog = (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ReasonDialog'), { + title: i18nc("@title:dialog", "Report Space"), + placeholder: i18nc("@info:placeholder", "Optionally give a reason for reporting this space"), + icon: "dialog-warning-symbolic", + actionText: i18nc("@action:button 'Report' as in 'Report this space to the administrators'", "Report"), + reporting: true, + connection: root.room.connection, + }, { + title: i18nc("@title", "Report Space"), + width: Kirigami.Units.gridUnit * 25 + }) as ReasonDialog; + dialog.accepted.connect(reason => { + root.room.report(reason); + }); + } + } QQC2.Button { id: settingsButton