@@ -210,22 +210,25 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
210210
211211 case messages.EvalSessionMsg :
212212 evalFile , _ := evaluation .Save (a .application .Session (), msg .Filename )
213- return a , core . CmdHandler ( notification.ShowMsg { Text : fmt .Sprintf ("Eval saved to file %s" , evalFile )} )
213+ return a , notification .SuccessCmd ( fmt .Sprintf ("Eval saved to file %s" , evalFile ))
214214
215215 case messages.CompactSessionMsg :
216216 return a , a .chatPage .CompactSession ()
217217
218218 case messages.CopySessionToClipboardMsg :
219219 transcript := a .application .PlainTextTranscript ()
220220 if transcript == "" {
221- return a , core . CmdHandler ( notification.ShowMsg { Text : "Conversation is empty; nothing copied." } )
221+ return a , notification .SuccessCmd ( "Conversation is empty; nothing copied." )
222222 }
223223
224- if err := clipboard .WriteAll (transcript ); err != nil {
225- return a , core .CmdHandler (notification.ShowMsg {Text : "Failed to copy conversation: " + err .Error (), Type : notification .TypeError })
226- }
227-
228- return a , core .CmdHandler (notification.ShowMsg {Text : "Conversation copied to clipboard." })
224+ return a , tea .Sequence (
225+ tea .SetClipboard (transcript ),
226+ func () tea.Msg {
227+ _ = clipboard .WriteAll (transcript )
228+ return nil
229+ },
230+ notification .SuccessCmd ("Conversation copied to clipboard." ),
231+ )
229232
230233 case messages.ToggleYoloMsg :
231234 sess := a .application .Session ()
@@ -236,7 +239,7 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
236239 } else {
237240 statusText = "Yolo mode disabled: tools will require confirmation"
238241 }
239- return a , core . CmdHandler ( notification.ShowMsg { Text : statusText } )
242+ return a , notification .SuccessCmd ( statusText )
240243
241244 case messages.AgentCommandMsg :
242245 resolvedCommand := a .application .ResolveCommand (context .Background (), msg .Command )
@@ -246,7 +249,7 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
246249 // Convert the interface{} back to mcptools.PromptInfo
247250 promptInfo , ok := msg .PromptInfo .(mcptools.PromptInfo )
248251 if ! ok {
249- return a , core . CmdHandler ( notification.ShowMsg { Text : "Invalid prompt info" } )
252+ return a , notification .ErrorCmd ( "Invalid prompt info" )
250253 }
251254 // Show the MCP prompt input dialog
252255 return a , core .CmdHandler (dialog.OpenDialogMsg {
@@ -258,7 +261,7 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
258261 promptContent , err := a .application .ExecuteMCPPrompt (context .Background (), msg .PromptName , msg .Arguments )
259262 if err != nil {
260263 errorMsg := fmt .Sprintf ("Error executing MCP prompt '%s': %v" , msg .PromptName , err )
261- return a , core . CmdHandler ( notification.ShowMsg { Text : errorMsg } )
264+ return a , notification .ErrorCmd ( errorMsg )
262265 }
263266 return a , core .CmdHandler (editor.SendMsg {Content : promptContent })
264267
0 commit comments