Fix scrolling.

This commit is contained in:
Bartosz Taudul
2025-05-17 01:29:09 +02:00
parent 41f9b75372
commit 46c000fd66
2 changed files with 1 additions and 6 deletions

View File

@@ -414,10 +414,9 @@ void TracyLlm::Draw()
idx++;
}
if( m_wasUpdated )
if( ImGui::GetScrollY() >= ImGui::GetScrollMaxY() )
{
ImGui::SetScrollHereY( 1.f );
m_wasUpdated = false;
}
ImGui::PopID();
}
@@ -460,7 +459,6 @@ void TracyLlm::Draw()
m_chat->emplace_back( ollama::message( "user", m_input ) );
*m_input = 0;
m_responding = true;
m_wasUpdated = true;
m_jobs.emplace_back( WorkItem {
.task = Task::SendMessage,
@@ -576,7 +574,6 @@ void TracyLlm::SendMessage( const ollama::messages& messages )
m_chat->emplace_back( ollama::message( "error", e.what() ) );
m_responding = false;
m_stop = false;
m_wasUpdated = true;
return;
}
@@ -621,7 +618,6 @@ bool TracyLlm::OnResponse( const ollama::response& response )
auto responseStr = response.as_simple_string();
std::erase( responseStr, '\r' );
content = str + responseStr;
m_wasUpdated = true;
m_usedCtx++;
auto& json = response.as_json();

View File

@@ -120,7 +120,6 @@ private:
bool m_busy = false;
bool m_responding = false;
bool m_stop = false;
bool m_wasUpdated = false;
bool m_focusInput = false;
int m_chatId = 0;
int m_usedCtx = 0;