forked from Shinonome/dots-hyprland
feat(ai): Add auto-scroll functionality to AI chat (#1972)
This commit is contained in:
@@ -209,6 +209,9 @@ 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.positionViewAtEnd()
|
||||
}
|
||||
|
||||
Process {
|
||||
@@ -316,6 +319,15 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
||||
|
||||
property int lastResponseLength: 0
|
||||
|
||||
property bool shouldAutoScroll: true
|
||||
onContentYChanged: shouldAutoScroll = atYEnd
|
||||
onContentHeightChanged: {
|
||||
if (shouldAutoScroll) positionViewAtEnd();
|
||||
}
|
||||
onCountChanged: { // Auto-scroll when new messages are added
|
||||
if (shouldAutoScroll) positionViewAtEnd();
|
||||
}
|
||||
|
||||
clip: true
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
|
||||
Reference in New Issue
Block a user