From 31e782a36f0d331f6325f17c78b7b44fb2f11414 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:50:53 +0200 Subject: [PATCH] ai chat: prevent function call message from abrupt jumps --- .config/quickshell/modules/common/widgets/StyledListView.qml | 5 +++-- .config/quickshell/modules/sidebarLeft/AiChat.qml | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.config/quickshell/modules/common/widgets/StyledListView.qml b/.config/quickshell/modules/common/widgets/StyledListView.qml index 835b9a43a..76d9782b4 100644 --- a/.config/quickshell/modules/common/widgets/StyledListView.qml +++ b/.config/quickshell/modules/common/widgets/StyledListView.qml @@ -18,6 +18,7 @@ ListView { property real removeOvershoot: 20 // Account for gaps and bouncy animations property int dragIndex: -1 property real dragDistance: 0 + property bool popin: true function resetDrag() { root.dragIndex = -1 @@ -27,7 +28,7 @@ ListView { add: Transition { animations: [ Appearance?.animation.elementMove.numberAnimation.createObject(this, { - properties: "opacity,scale", + properties: popin ? "opacity,scale" : "opacity", from: 0, to: 1, }), @@ -40,7 +41,7 @@ ListView { property: "y", }), Appearance?.animation.elementMove.numberAnimation.createObject(this, { - properties: "opacity,scale", + properties: popin ? "opacity,scale" : "opacity", to: 1, }), ] diff --git a/.config/quickshell/modules/sidebarLeft/AiChat.qml b/.config/quickshell/modules/sidebarLeft/AiChat.qml index 6eb069e94..b78ff89ce 100644 --- a/.config/quickshell/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/modules/sidebarLeft/AiChat.qml @@ -162,6 +162,7 @@ int main(int argc, char* argv[]) { id: messageListView anchors.fill: parent spacing: 10 + popin: false property int lastResponseLength: 0 @@ -175,6 +176,8 @@ int main(int argc, char* argv[]) { } } + add: null // Prevent function calls from being janky + Behavior on contentY { NumberAnimation { id: scrollAnim