kf5: add emoji reaction buttons on assistant messages

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.
This commit is contained in:
Levi Neely 2026-07-27 15:33:33 +02:00
parent 582ea51126
commit 7b59e11f6d
3 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);