feat: hide tool calls

This commit is contained in:
adamdottv
2025-05-05 11:25:34 -05:00
parent 874715838a
commit efaba6c5b8
3 changed files with 56 additions and 32 deletions

View File

@@ -26,8 +26,9 @@ type chatPage struct {
}
type ChatKeyMap struct {
NewSession key.Binding
Cancel key.Binding
NewSession key.Binding
Cancel key.Binding
ToggleTools key.Binding
}
var keyMap = ChatKeyMap{
@@ -39,6 +40,10 @@ var keyMap = ChatKeyMap{
key.WithKeys("esc"),
key.WithHelp("esc", "cancel"),
),
ToggleTools: key.NewBinding(
key.WithKeys("ctrl+h"),
key.WithHelp("ctrl+h", "toggle tools"),
),
}
func (p *chatPage) Init() tea.Cmd {
@@ -98,6 +103,8 @@ func (p *chatPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
p.app.CoderAgent.Cancel(p.session.ID)
return p, nil
}
case key.Matches(msg, keyMap.ToggleTools):
return p, util.CmdHandler(chat.ToggleToolMessagesMsg{})
}
}
u, cmd := p.layout.Update(msg)