From 17525622793c981e4dcb41188d834ab178855dcb Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 29 Mar 2026 19:55:52 +0700 Subject: [PATCH] Show delivery failure reason in red on the queue status bar Right-align the postqueue failure reason in red on the same status bar line, rendered as a separate segment with matching background to avoid breaking the layout. Co-Authored-By: Claude Sonnet 4.6 --- model.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/model.go b/model.go index fd4aafa..65d5242 100644 --- a/model.go +++ b/model.go @@ -43,7 +43,7 @@ type Model struct { saveNotice string width int height int - messageSaving bool + messageSaving bool // stateParts fields parts []MessagePart partsCursor int @@ -478,13 +478,17 @@ func (m Model) renderBottom() string { label := fmt.Sprintf(" Fetching subjects: %d / %d ", m.loadingDone, m.loadingTotal) return dimStyle.Render(label) + "\n " + m.progress.View() } - status := statusBarStyle.Render( - fmt.Sprintf(" %d message(s) │ Enter: open │ r: refresh │ F: flush │ q: quit ", len(m.list.Items())), - ) + left := fmt.Sprintf(" %d message(s) │ Enter: open │ r: refresh │ F: flush │ q: quit ", len(m.list.Items())) + reason := "" if item, ok := m.list.SelectedItem().(queueItem); ok { - if reason := item.entry.Reason; reason != "" { - return status + "\n " + reasonStyle.Render(reason) - } + reason = item.entry.Reason } - return status + if reason == "" { + return statusBarStyle.Render(left) + } + right := " " + reason + " " + rightWidth := lipgloss.Width(right) + leftPart := statusBarStyle.Width(m.width - rightWidth).Render(left) + rightPart := lipgloss.NewStyle().Foreground(lipgloss.Color("196")).Background(lipgloss.Color("241")).Render(right) + return leftPart + rightPart }