(filePath string)
| 797 | } |
| 798 | |
| 799 | func (m *appModel) handleAttachFile(filePath string) (tea.Model, tea.Cmd) { |
| 800 | if filePath != "" { |
| 801 | if err := m.editor.AttachFile(filePath); err != nil { |
| 802 | slog.Warn("failed to attach file", "path", filePath, "error", err) |
| 803 | // Attachment failed — open the file picker with an error notification |
| 804 | return m, tea.Batch( |
| 805 | notification.ErrorCmd("Failed to attach "+filePath), |
| 806 | core.CmdHandler(dialog.OpenDialogMsg{ |
| 807 | Model: dialog.NewFilePickerDialog(filePath), |
| 808 | }), |
| 809 | ) |
| 810 | } |
| 811 | return m, notification.SuccessCmd("File attached: " + filePath) |
| 812 | } |
| 813 | |
| 814 | // No path provided — open the file picker dialog |
| 815 | return m, core.CmdHandler(dialog.OpenDialogMsg{ |
| 816 | Model: dialog.NewFilePickerDialog(filePath), |
| 817 | }) |
| 818 | } |
| 819 | |
| 820 | // --- Speech-to-text --- |
| 821 |
no test coverage detected