Merge branch 'dev' into project

This commit is contained in:
Dax Raad
2025-08-30 15:22:48 -04:00
178 changed files with 4250 additions and 6791 deletions
@@ -489,11 +489,22 @@ func (m *editorComponent) Submit() (tea.Model, tea.Cmd) {
var cmds []tea.Cmd
if strings.HasPrefix(value, "/") {
value = value[1:]
commandName := strings.Split(value, " ")[0]
// Expand attachments in the value to get actual content
expandedValue := value
attachments := m.textarea.GetAttachments()
for _, att := range attachments {
if att.Type == "text" && att.Source != nil {
if textSource, ok := att.Source.(*attachment.TextSource); ok {
expandedValue = strings.Replace(expandedValue, att.Display, textSource.Value, 1)
}
}
}
expandedValue = expandedValue[1:] // Remove the "/"
commandName := strings.Split(expandedValue, " ")[0]
command := m.app.Commands[commands.CommandName(commandName)]
if command.Custom {
args := strings.TrimPrefix(value, command.PrimaryTrigger()+" ")
args := strings.TrimPrefix(expandedValue, command.PrimaryTrigger()+" ")
cmds = append(
cmds,
util.CmdHandler(app.SendCommand{Command: string(command.Name), Args: args}),
@@ -1173,10 +1173,10 @@ func (m *messagesComponent) UndoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to undo message", "error", err)
return toast.NewErrorToast("Failed to undo message")
return toast.NewErrorToast("Failed to undo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to undo message")
return toast.NewErrorToast("Failed to undo message")()
}
return app.MessageRevertedMsg{Session: *response, Message: revertedMessage}
}
@@ -1241,10 +1241,10 @@ func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to unrevert session", "error", err)
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
return app.SessionUnrevertedMsg{Session: *response}
}
@@ -1261,10 +1261,10 @@ func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
)
if err != nil {
slog.Error("Failed to redo message", "error", err)
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
if response == nil {
return toast.NewErrorToast("Failed to redo message")
return toast.NewErrorToast("Failed to redo message")()
}
return app.MessageRevertedMsg{Session: *response, Message: revertedMessage}
}