From 7b59e11f6d378eea2adc1e69c8cd89d6d5c0dc6b Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Mon, 27 Jul 2026 15:33:33 +0200 Subject: [PATCH] kf5: add emoji reaction buttons on assistant messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reaction buttons (👍👎🚀💩🤔) appear on hover over assistant chat bubbles. Clicking one calls the React D-Bus method which records the feedback in session history without triggering a model turn. Also adds react() to OllieDBusClient. --- gui/main-kf5.qml | 30 +++++++++++++++++++++++++++++ plasmoid/plugin/olliedbusclient.cpp | 6 ++++++ plasmoid/plugin/olliedbusclient.h | 1 + 3 files changed, 37 insertions(+) diff --git a/gui/main-kf5.qml b/gui/main-kf5.qml index c1b9c89..7102dbc 100644 --- a/gui/main-kf5.qml +++ b/gui/main-kf5.qml @@ -1508,6 +1508,36 @@ ApplicationWindow { Behavior on opacity { NumberAnimation { duration: 150 } } } + // Reaction buttons + Row { + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.margins: 4 + z: 10 + spacing: 2 + opacity: assistantHover.hovered ? 0.9 : 0 + Behavior on opacity { NumberAnimation { duration: 150 } } + + Repeater { + model: [ + { emoji: "\uD83D\uDC4D", tip: "Good" }, + { emoji: "\uD83D\uDC4E", tip: "Bad" }, + { emoji: "\uD83D\uDE80", tip: "Excellent" }, + { emoji: "\uD83D\uDCA9", tip: "Very bad" }, + { emoji: "\uD83E\uDD14", tip: "Confused" } + ] + ToolButton { + text: modelData.emoji + font.pixelSize: 14 + implicitWidth: 28 + implicitHeight: 28 + onClicked: dbus.react(paneRoot.sessionId, modelData.emoji) + ToolTip.text: modelData.tip + ToolTip.visible: hovered + } + } + } + ColumnLayout { id: assistantContent anchors.fill: parent diff --git a/plasmoid/plugin/olliedbusclient.cpp b/plasmoid/plugin/olliedbusclient.cpp index 7716053..6e4b0fd 100644 --- a/plasmoid/plugin/olliedbusclient.cpp +++ b/plasmoid/plugin/olliedbusclient.cpp @@ -457,6 +457,12 @@ bool OllieDBusClient::submit(const QString &sessionId, const QString &prompt) return true; } +bool OllieDBusClient::react(const QString &sessionId, const QString &emoji) +{ + m_iface->asyncCall("React", sessionId, emoji); + return true; +} + bool OllieDBusClient::interrupt(const QString &sessionId) { m_iface->asyncCall("Interrupt", sessionId); diff --git a/plasmoid/plugin/olliedbusclient.h b/plasmoid/plugin/olliedbusclient.h index 1ad2b90..96e7dc3 100644 --- a/plasmoid/plugin/olliedbusclient.h +++ b/plasmoid/plugin/olliedbusclient.h @@ -53,6 +53,7 @@ public: Q_INVOKABLE bool renameSession(const QString &sessionId, const QString &newName); Q_INVOKABLE bool setConfig(const QString &sessionId, const QString &key, const QString &value); Q_INVOKABLE bool submit(const QString &sessionId, const QString &prompt); + Q_INVOKABLE bool react(const QString &sessionId, const QString &emoji); Q_INVOKABLE bool interrupt(const QString &sessionId); Q_INVOKABLE QStringList listBackends(); Q_INVOKABLE QStringList listModels(const QString &sessionId);