summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-24 18:05:05 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-24 18:05:05 +0300
commit27288e2aaae1e5a8bac35f718ce33921277236d1 (patch)
treef7f7bfc4b80d8576455783b53e8bebf0c4928c0e /bot.go
parent1c728ec7a776c27887ab4b436a6ec6dfc17aaa6d (diff)
Enha: spinner to indicate llm response
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/bot.go b/bot.go
index 1c24f9a..cd2e31d 100644
--- a/bot.go
+++ b/bot.go
@@ -826,8 +826,26 @@ func chatWatcher(ctx context.Context) {
}
}
+// inpired by https://github.com/rivo/tview/issues/225
+func showSpinner() {
+ spinners := []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
+ var i int
+ for botRespMode {
+ time.Sleep(100 * time.Millisecond)
+ spin := i % len(spinners)
+ app.QueueUpdateDraw(func() {
+ textArea.SetTitle(spinners[spin] + " input")
+ })
+ i++
+ }
+ app.QueueUpdateDraw(func() {
+ textArea.SetTitle("input")
+ })
+}
+
func chatRound(r *models.ChatRoundReq) error {
botRespMode = true
+ go showSpinner()
updateStatusLine()
botPersona := cfg.AssistantRole
if cfg.WriteNextMsgAsCompletionAgent != "" {