Skip to content

Commit 9544d79

Browse files
committed
Fix event filtering: allow user interaction detection regardless of
generation state The ChatEditor::eventFilter method previously wrapped its interaction logic inside an if (m_input && m_input->isGenerating()) guard. This meant that the editor only recorded scroll, mouse, or key events while the model was actively generating text. This could result in a scroll to bottom event when the follow-up questions were received.
1 parent 2230aee commit 9544d79

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llamachateditor.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -778,14 +778,12 @@ void ChatEditor::scrollToBottom()
778778

779779
bool ChatEditor::eventFilter(QObject *obj, QEvent *event)
780780
{
781-
if (m_input && m_input->isGenerating()) {
782-
if (obj == m_scrollArea || obj == m_scrollArea->verticalScrollBar()) {
783-
// Mouse wheel, mouse press, key press – any user interaction
784-
if (event->type() == QEvent::Wheel || event->type() == QEvent::MouseButtonPress
785-
|| event->type() == QEvent::MouseButtonRelease
786-
|| event->type() == QEvent::KeyPress) {
787-
m_userInteracted = true;
788-
}
781+
if (obj == m_scrollArea || obj == m_scrollArea->verticalScrollBar()) {
782+
// Mouse wheel, mouse press, key press – any user interaction
783+
if (event->type() == QEvent::Wheel || event->type() == QEvent::MouseButtonPress
784+
|| event->type() == QEvent::MouseButtonRelease
785+
|| event->type() == QEvent::KeyPress) {
786+
m_userInteracted = true;
789787
}
790788
}
791789
return QObject::eventFilter(obj, event);

0 commit comments

Comments
 (0)