From 07fb3160eb47eb0b8bfd308c9b103bfe4d0de0ec Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 27 Oct 2025 16:11:30 -0400 Subject: [PATCH] Add "Inspect Room Data" button in the room sidebar I find myself doing the same routine: I want to inspect a room's state, so I have to go hunting for the Developer Tools button. And then I have to do a few clicks to even get the correct room, what a waste of time! So I added a new button to the sidebar to open the Developer Tools for the current room. --- src/devtools/DevtoolsPage.qml | 1 + src/roominfo/RoomInformation.qml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/devtools/DevtoolsPage.qml b/src/devtools/DevtoolsPage.qml index 6ef7c0d13..32cf6e27d 100644 --- a/src/devtools/DevtoolsPage.qml +++ b/src/devtools/DevtoolsPage.qml @@ -17,6 +17,7 @@ Kirigami.ScrollablePage { property NeoChatRoom room required property NeoChatConnection connection + property alias currentTabIndex: tabBar.currentIndex title: i18nc("@title", "Developer Tools") diff --git a/src/roominfo/RoomInformation.qml b/src/roominfo/RoomInformation.qml index f9bbbd9b3..0e0e075dd 100644 --- a/src/roominfo/RoomInformation.qml +++ b/src/roominfo/RoomInformation.qml @@ -166,6 +166,25 @@ QQC2.ScrollView { } } + Delegates.RoundedItemDelegate { + text: i18nc("@action:inmenu", "Inspect Room Data") + icon.name: "tools" + visible: NeoChatConfig.developerTools + activeFocusOnTab: true + + Layout.fillWidth: true + + onClicked: ((QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow).pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), { + connection: root.room.connection, + currentTabIndex: 1, // Room data tab + room: root.room + }, { + title: i18nc("@title:window", "Developer Tools"), + width: Kirigami.Units.gridUnit * 50, + height: Kirigami.Units.gridUnit * 42 + }) + } + Delegates.RoundedItemDelegate { id: leaveButton icon.name: "arrow-left-symbolic"