From 372e49199b58281bf1c7f75dfa2835189bc61383 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Tue, 17 Feb 2026 13:15:09 +0300 Subject: Feat: collapse/expand thinking blocks with alt+t --- tui.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tui.go') diff --git a/tui.go b/tui.go index 31f4091..2883511 100644 --- a/tui.go +++ b/tui.go @@ -96,6 +96,7 @@ var ( [yellow]Alt+7[white]: toggle role injection (inject role in messages) [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 blocks) === scrolling chat window (some keys similar to vim) === [yellow]arrows up/down and j/k[white]: scroll up and down @@ -831,6 +832,20 @@ func init() { injectRole = !injectRole updateStatusLine() } + // Handle Alt+T to toggle thinking block visibility + if event.Key() == tcell.KeyRune && event.Rune() == 't' && event.Modifiers()&tcell.ModAlt != 0 { + thinkingCollapsed = !thinkingCollapsed + textView.SetText(chatToText(chatBody.Messages, cfg.ShowSys)) + colorText() + status := "expanded" + if thinkingCollapsed { + status = "collapsed" + } + if err := notifyUser("thinking", fmt.Sprintf("Thinking blocks %s", status)); err != nil { + logger.Error("failed to send notification", "error", err) + } + return nil + } if event.Key() == tcell.KeyF1 { // chatList, err := loadHistoryChats() chatList, err := store.GetChatByChar(cfg.AssistantRole) -- cgit v1.2.3