@@ -497,6 +497,11 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
497 case copyChatHighlightMsg:
497 case copyChatHighlightMsg:
498 cmds = append(cmds, m.copyChatHighlight())
498 cmds = append(cmds, m.copyChatHighlight())
499 case tea.MouseClickMsg:
499 case tea.MouseClickMsg:
500+ // Pass mouse events to dialogs first if any are open.
501+ if m.dialog.HasDialogs() {
502+ m.dialog.Update(msg)
503+ return m, tea.Batch(cmds...)
500 switch m.state {
505 switch m.state {
501 case uiChat:
506 case uiChat:
502 x, y := msg.X, msg.Y
507 x, y := msg.X, msg.Y
@@ -509,6 +514,12 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
511 case tea.MouseMotionMsg:
516 case tea.MouseMotionMsg:
517+ // Pass mouse events to dialogs first if any are open.
518+ if m.dialog.HasDialogs() {
519+ m.dialog.Update(msg)
520+ return m, tea.Batch(cmds...)
512 switch m.state {
523 switch m.state {
513 case uiChat:
524 case uiChat:
514 if msg.Y <= 0 {
525 if msg.Y <= 0 {
@@ -541,6 +552,11 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
543 case tea.MouseReleaseMsg:
554 case tea.MouseReleaseMsg:
555+ // Pass mouse events to dialogs first if any are open.
556+ if m.dialog.HasDialogs() {
557+ m.dialog.Update(msg)
558+ return m, tea.Batch(cmds...)
544 const doubleClickThreshold = 500 * time.Millisecond
560 const doubleClickThreshold = 500 * time.Millisecond
546 switch m.state {
562 switch m.state {