Enha: tool filter

This commit is contained in:
Grail Finder
2026-02-27 18:45:59 +03:00
parent c855c30ae2
commit 1fcab8365e
5 changed files with 186 additions and 60 deletions

15
tui.go
View File

@@ -99,6 +99,7 @@ var (
[yellow]Alt+8[white]: show char img or last picked img
[yellow]Alt+9[white]: warm up (load) selected llama.cpp model
[yellow]Alt+t[white]: toggle thinking blocks visibility (collapse/expand <think> blocks)
[yellow]Ctrl+t[white]: toggle tool call/response visibility (collapse/expand tool calls and non-shell tool responses)
[yellow]Alt+i[white]: show colorscheme selection popup
=== scrolling chat window (some keys similar to vim) ===
@@ -563,6 +564,20 @@ func init() {
}
return nil
}
// Handle Ctrl+T to toggle tool call/response visibility
if event.Key() == tcell.KeyRune && event.Rune() == 't' && event.Modifiers()&tcell.ModCtrl != 0 {
toolCollapsed = !toolCollapsed
textView.SetText(chatToText(chatBody.Messages, cfg.ShowSys))
colorText()
status := "expanded"
if toolCollapsed {
status = "collapsed"
}
if err := notifyUser("tools", "Tool calls/responses "+status); err != nil {
logger.Error("failed to send notification", "error", err)
}
return nil
}
if event.Key() == tcell.KeyRune && event.Rune() == 'i' && event.Modifiers()&tcell.ModAlt != 0 {
if isFullScreenPageActive() {
return event