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 {
|
else {
|
||||||
Ai.sendUserMessage(inputText);
|
Ai.sendUserMessage(inputText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always scroll to bottom when user sends a message
|
||||||
|
messageListView.positionViewAtEnd()
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
@@ -316,6 +319,15 @@ Inline w/ backslash and round brackets \\(e^{i\\pi} + 1 = 0\\)
|
|||||||
|
|
||||||
property int lastResponseLength: 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
|
clip: true
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: OpacityMask {
|
layer.effect: OpacityMask {
|
||||||
|
|||||||
Reference in New Issue
Block a user