From feda206462824b52adad1fff83b04599c3076509 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 4 Dec 2026 11:32:58 +0100 Subject: 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 --- desktop/assistant/Card.qml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'desktop/assistant/Card.qml') diff --git a/desktop/assistant/Card.qml b/desktop/assistant/Card.qml index f4e1af1..15819c6 100644 --- a/desktop/assistant/Card.qml +++ b/desktop/assistant/Card.qml @@ -40,6 +40,7 @@ Rectangle { + (status.visible ? status.height + 10 : 0) + (actions.visible ? actions.height + 10 : 0) Behavior on height { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } } + Behavior on width { NumberAnimation { duration: 180; easing.type: Easing.OutCubic } } clip: true color: Qt.alpha(Theme.base, 0.82) @@ -161,12 +162,53 @@ Rectangle { function onChattingChanged() { input.forceActiveFocus(); } } + // --- title bar (chat): the face, the chat's title, enlarge and close --- + + Item { + id: titleBar + visible: card.mode === "chat" + anchors { top: parent.top; left: parent.left; right: parent.right; margins: 14 } + height: 28 + + Avatar { + anchors { left: parent.left; verticalCenter: parent.verticalCenter } + width: 28 + source: card.canvas.face.length ? card.canvas.fileUrl(card.canvas.backdrop) : "" + crop: card.canvas.face + } + Text { + anchors.centerIn: parent + width: Math.min(implicitWidth, parent.width - 2 * (winBtns.width + 12)) + elide: Text.ElideRight + text: card.canvas.title || "Desktop Assistant" + color: Theme.subtext + font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2; bold: true } + } + // nf-fa-compress / nf-fa-expand and nf-fa-xmark, as Keystone's + // titlebar. + Row { + id: winBtns + anchors { right: parent.right; verticalCenter: parent.verticalCenter } + spacing: 6 + WindowButton { + icon: card.canvas.big ? "\uf066" : "\uf065" + onClicked: card.canvas.big = !card.canvas.big + } + WindowButton { + icon: "\uf00d" + danger: true + onClicked: card.canvas.close() + } + } + } + // --- header (chat) --- Item { id: header visible: card.mode === "chat" - anchors { top: parent.top; left: parent.left; right: parent.right; margins: 14 } + anchors { top: titleBar.bottom; left: parent.left; right: parent.right + topMargin: 8; leftMargin: 14; rightMargin: 14 } height: 32 // The chat's model, a click opens the model panel. nf-fa-cloud for a -- cgit v1.2.3