summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-12-31 16:18:18 +0300
committerGrail Finder <wohilas@gmail.com>2025-12-31 16:18:18 +0300
commit5b8880ebc80e3ce4ab4bc5118d1ca657e84c8834 (patch)
tree87a00c2cb69792835e93cb7f094d26c2f35f054b /bot.go
parent03e1f5dc6dc12a0128dcff3f2a0b8cb128bf04a8 (diff)
Feat: scroll to end toggle
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/bot.go b/bot.go
index e8a40a7..b91c6e4 100644
--- a/bot.go
+++ b/bot.go
@@ -674,7 +674,9 @@ out:
case chunk := <-chunkChan:
fmt.Fprint(tv, chunk)
respText.WriteString(chunk)
- tv.ScrollToEnd()
+ if scrollToEndEnabled {
+ tv.ScrollToEnd()
+ }
// Send chunk to audio stream handler
if cfg.TTS_ENABLED {
extra.TTSTextChan <- chunk
@@ -682,14 +684,18 @@ out:
case toolChunk := <-openAIToolChan:
fmt.Fprint(tv, toolChunk)
toolResp.WriteString(toolChunk)
- tv.ScrollToEnd()
+ if scrollToEndEnabled {
+ tv.ScrollToEnd()
+ }
case <-streamDone:
// drain any remaining chunks from chunkChan before exiting
for len(chunkChan) > 0 {
chunk := <-chunkChan
fmt.Fprint(tv, chunk)
respText.WriteString(chunk)
- tv.ScrollToEnd()
+ if scrollToEndEnabled {
+ tv.ScrollToEnd()
+ }
// Send chunk to audio stream handler
if cfg.TTS_ENABLED {
extra.TTSTextChan <- chunk
@@ -1130,5 +1136,7 @@ func init() {
if cfg.STT_ENABLED {
asr = extra.NewSTT(logger, cfg)
}
+ // Initialize scrollToEndEnabled based on config
+ scrollToEndEnabled = cfg.AutoScrollEnabled
go updateModelLists()
}