feat(tui): /editor - change the auto-send behavior to put content in input box instead (#827)

This commit is contained in:
Adi Yeroslav
2025-07-10 13:57:52 +03:00
committed by GitHub
parent c411a26d6f
commit a1701678cd
3 changed files with 15 additions and 1 deletions

View File

@@ -390,6 +390,12 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.showCompletionDialog = false
a.app, cmd = a.app.SendChatMessage(context.Background(), msg.Text, msg.Attachments)
cmds = append(cmds, cmd)
case app.SetEditorContentMsg:
// Set the editor content without sending
a.editor.SetValue(msg.Text)
updated, cmd := a.editor.Focus()
a.editor = updated.(chat.EditorComponent)
cmds = append(cmds, cmd)
case dialog.CompletionDialogCloseMsg:
a.showCompletionDialog = false
a.fileCompletionActive = false
@@ -858,7 +864,7 @@ func (a appModel) executeCommand(command commands.Command) (tea.Model, tea.Cmd)
return nil
}
os.Remove(tmpfile.Name())
return app.SendMsg{
return app.SetEditorContentMsg{
Text: string(content),
}
})