From e5033c3213adabb872f747a22a1678278230b059 Mon Sep 17 00:00:00 2001 From: Gwendolyn Page Date: Thu, 11 Sep 2025 17:19:05 -0500 Subject: [PATCH 1/2] feat(ai): Add auto-scroll functionality to AI chat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add shouldAutoScroll property to track when user wants auto-scrolling - Auto-scroll when user sends a message to see the response - Auto-scroll during streaming when content height changes - Auto-scroll when new messages are added to the conversation - Stop auto-scroll when user manually scrolls up (preserves user intent) - Resume auto-scroll when user scrolls back to bottom 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../ii/modules/sidebarLeft/AiChat.qml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index 22a64412c..6c69603f1 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -209,6 +209,10 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) else { Ai.sendUserMessage(inputText); } + + // Always scroll to bottom when user sends a message + messageListView.shouldAutoScroll = true + messageListView.positionViewAtEnd() } Process { @@ -316,6 +320,28 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) property int lastResponseLength: 0 + // Simple auto-scroll state tracking (proven chat pattern) + property bool shouldAutoScroll: true + + // Track when user scrolls - simple and reliable + onContentYChanged: { + shouldAutoScroll = atYEnd + } + + // Auto-scroll when content height changes (during streaming) + onContentHeightChanged: { + if (shouldAutoScroll) { + positionViewAtEnd() + } + } + + // Auto-scroll when new messages are added + onCountChanged: { + if (shouldAutoScroll) { + positionViewAtEnd() + } + } + clip: true layer.enabled: true layer.effect: OpacityMask { From df7504d4a225fd9228f49856ed7cca1262af2764 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sun, 21 Sep 2025 19:51:15 +0200 Subject: [PATCH 2/2] remove useless ai comments --- .../ii/modules/sidebarLeft/AiChat.qml | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml index 6c69603f1..be0ee350d 100644 --- a/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml +++ b/.config/quickshell/ii/modules/sidebarLeft/AiChat.qml @@ -211,7 +211,6 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) } // Always scroll to bottom when user sends a message - messageListView.shouldAutoScroll = true messageListView.positionViewAtEnd() } @@ -320,26 +319,13 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\) property int lastResponseLength: 0 - // Simple auto-scroll state tracking (proven chat pattern) property bool shouldAutoScroll: true - - // Track when user scrolls - simple and reliable - onContentYChanged: { - shouldAutoScroll = atYEnd - } - - // Auto-scroll when content height changes (during streaming) + onContentYChanged: shouldAutoScroll = atYEnd onContentHeightChanged: { - if (shouldAutoScroll) { - positionViewAtEnd() - } + if (shouldAutoScroll) positionViewAtEnd(); } - - // Auto-scroll when new messages are added - onCountChanged: { - if (shouldAutoScroll) { - positionViewAtEnd() - } + onCountChanged: { // Auto-scroll when new messages are added + if (shouldAutoScroll) positionViewAtEnd(); } clip: true