Feat(tts) alt+0 to replay last message in the chat

This commit is contained in:
Grail Finder
2026-02-18 13:15:40 +03:00
parent 5548991f5c
commit f40f09390b
3 changed files with 59 additions and 41 deletions

13
tui.go
View File

@@ -83,6 +83,7 @@ var (
[yellow]Ctrl+l[white]: show model selection popup to choose current model
[yellow]Ctrl+k[white]: switch tool use (recommend tool use to llm after user msg)
[yellow]Ctrl+a[white]: interrupt tts (needs tts server)
[yellow]Alt+0[white]: replay last message via tts (needs tts server)
[yellow]Ctrl+g[white]: open RAG file manager (load files for context retrieval)
[yellow]Ctrl+y[white]: list loaded RAG files (view and manage loaded files)
[yellow]Ctrl+q[white]: show user role selection popup to choose who sends next msg as
@@ -1144,6 +1145,18 @@ func init() {
if event.Key() == tcell.KeyCtrlA && cfg.TTS_ENABLED {
TTSDoneChan <- true
}
if event.Key() == tcell.KeyRune && event.Rune() == '0' && event.Modifiers()&tcell.ModAlt != 0 && cfg.TTS_ENABLED {
if len(chatBody.Messages) > 0 {
// Stop any currently playing TTS first
TTSDoneChan <- true
lastMsg := chatBody.Messages[len(chatBody.Messages)-1]
cleanedText := models.CleanText(lastMsg.Content)
if cleanedText != "" {
go orator.Speak(cleanedText)
}
}
return nil
}
if event.Key() == tcell.KeyCtrlW {
// INFO: continue bot/text message
// without new role