aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/assistant/Assistant.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-12-04 11:32:58 +0100
committerDanilo M. <danix@danix.xyz>2026-12-04 11:32:58 +0100
commitfeda206462824b52adad1fff83b04599c3076509 (patch)
tree6880209e972f6e5298b5ec993ddf2bbd9a6310d0 /desktop/assistant/Assistant.qml
parent2830b2c1dd5ebe8ebcb5a48816479eff0b0950f6 (diff)
downloadquickshell-feda206462824b52adad1fff83b04599c3076509.tar.gz
quickshell-feda206462824b52adad1fff83b04599c3076509.zip
feat(assistant): title bar with face, chat title, enlarge and close
A row above the chat header: the assistant's face, the chat's title from the daemon ("Desktop Assistant" until it has one), and enlarge and close. Enlarged, the tall card fills the screen but a margin, for the session. Avatar moves out of Message.qml to be shared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/assistant/Assistant.qml')
-rw-r--r--desktop/assistant/Assistant.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/desktop/assistant/Assistant.qml b/desktop/assistant/Assistant.qml
index 7d299eb..aaf5328 100644
--- a/desktop/assistant/Assistant.qml
+++ b/desktop/assistant/Assistant.qml
@@ -81,6 +81,9 @@ Scope {
property int ctxUsed: 0
property int ctxMax: 0
property var convId: null
+ // The chat's title in the card's title bar: the daemon's (hello,
+ // conversation, then title once the model names it), "" for none.
+ property string title: ""
property string notice: "" // an error with no turn to hang it on
property string runningTool: ""
property var convs: []
@@ -112,7 +115,11 @@ Scope {
// The tall card (a chat, or a panel) is fullHeight and centred, so its
// top only moves on entering or leaving tall.
readonly property bool tall: root.mode === "chat" || root.historyOpen || root.pickerOpen || root.modelsOpen
- readonly property int fullHeight: Math.round(root.screenObj.height * 0.7)
+ // Enlarged (the header's expand button): the tall card fills the
+ // screen but a margin. ponytail: per session, not saved in Prefs.
+ property bool big: false
+ readonly property int fullHeight: root.big ? root.screenObj.height - 48
+ : Math.round(root.screenObj.height * 0.7)
function toggle() { if (root.open) root.close(); else root.show(); }
@@ -430,6 +437,7 @@ print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""),
root.runningTool = e.state === "tool" ? e.tool : "";
root.model = e.model ?? "";
root.chatModel = e.chat_model ?? "";
+ root.title = e.title ?? "";
if (e.out_dir) root.outDir = e.out_dir;
root.ctxUsed = e.ctx_used;
root.ctxMax = e.ctx_max;
@@ -442,6 +450,7 @@ print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""),
case "conversation":
root.load(e.id, e.turns, null);
root.chatModel = e.model ?? "";
+ root.title = e.title ?? "";
// Opened from History on purpose: it counts as active now.
if (e.turns.length) root.lastActive = Date.now();
// Emptied (New, or the current one deleted) with nothing staged:
@@ -501,6 +510,7 @@ print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""),
break;
// ctx carries the model since the router can swap it after hello; an
// older daemon leaves it out, and the hello's name stands.
+ case "title": if (e.id === root.convId) root.title = e.title; break;
case "ctx": root.ctxUsed = e.used; root.ctxMax = e.max; if (e.model) root.model = e.model; break;
case "conversations": root.convs = e.items; break;
case "results": root.results = e.items; break;
@@ -573,7 +583,7 @@ print(json.dumps({"bg": os.path.expanduser(a.get("background") or ""),
Card {
anchors.centerIn: parent
- width: Math.min(760, parent.width - 48)
+ width: root.big && root.tall ? parent.width - 48 : Math.min(760, parent.width - 48)
fullHeight: root.fullHeight
canvas: root
turnModel: turns