aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/ai/AiRow.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 09:28:33 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 09:28:33 +0200
commit10bee0184488ffe18b5621578811092ccfb6a405 (patch)
treec6f3eee1c6d8bfbab7b6c801f4855a8f6f9ab7ac /desktop/modules/ai/AiRow.qml
parent5b80aa009289bd004fbca0658863f284c84384a3 (diff)
downloadquickshell-10bee0184488ffe18b5621578811092ccfb6a405.tar.gz
quickshell-10bee0184488ffe18b5621578811092ccfb6a405.zip
ai: Restart for the desktop assistant and local chat
A Restart button sits before Stop on a running app that has a restart control. The assistant uses assistant.sh restart. llamachat has none, and its --quit answers before the app has exited, so a --daemon sent straight after finds an instance still running and does nothing: the restart quits, waits for --ping to fail (5s at most), then starts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/ai/AiRow.qml')
-rw-r--r--desktop/modules/ai/AiRow.qml18
1 files changed, 15 insertions, 3 deletions
diff --git a/desktop/modules/ai/AiRow.qml b/desktop/modules/ai/AiRow.qml
index ac4a180..2950759 100644
--- a/desktop/modules/ai/AiRow.qml
+++ b/desktop/modules/ai/AiRow.qml
@@ -12,8 +12,9 @@
import QtQuick
import "../.."
-// One engine or app: a state dot, a name, a detail line, and at most one
-// button. An empty action means no button, which is every engine row.
+// One engine or app: a state dot, a name, a detail line, at most one
+// button, and a Restart before it when restartable. An empty action means no
+// button, which is every engine row.
Rectangle {
id: row
@@ -23,7 +24,9 @@ Rectangle {
property bool busy: false
property string action: ""
property bool danger: false
+ property bool restartable: false
signal triggered
+ signal restart
implicitHeight: Math.max(texts.implicitHeight, btn.visible ? btn.implicitHeight : 0) + 16
radius: 8
@@ -40,7 +43,8 @@ Rectangle {
id: texts
anchors {
left: dot.right; leftMargin: 10
- right: btn.visible ? btn.left : parent.right; rightMargin: 10
+ right: restartBtn.visible ? restartBtn.left : btn.visible ? btn.left : parent.right
+ rightMargin: 10
verticalCenter: parent.verticalCenter
}
spacing: 2
@@ -63,6 +67,14 @@ Rectangle {
}
Button {
+ id: restartBtn
+ anchors { right: btn.left; rightMargin: 6; verticalCenter: parent.verticalCenter }
+ visible: row.restartable
+ text: "Restart"
+ onClicked: row.restart()
+ }
+
+ Button {
id: btn
anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
visible: row.action !== ""