Skip to content

Commit 82a333f

Browse files
authored
Merge pull request #187 from hookdeck/fix/dupe-quit-in-status-bar
fix: status bar duplicates and width handling
2 parents 81aec47 + f27716b commit 82a333f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

pkg/listen/tui/view.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,13 @@ func (m Model) renderStatusBar() string {
190190
// If no events yet, just show quit instruction
191191
selectedEvent := m.GetSelectedEvent()
192192
if selectedEvent == nil {
193-
return statusBarStyle.Render("[q] Quit")
193+
return statusBarStyle.Width(m.width).Render("[q] Quit")
194194
}
195195

196196
// Determine width-based verbosity
197-
isNarrow := m.width < 100
197+
// Threshold chosen to show full text only when it fits without wrapping
198+
// Full text requires ~105 chars with some padding
199+
isNarrow := m.width < 108
198200
isVeryNarrow := m.width < 60
199201

200202
// Build event status message
@@ -213,7 +215,7 @@ func (m Model) renderStatusBar() string {
213215
eventStatusMsg = fmt.Sprintf("> %s %s succeeded [%d] | [r] [o] [d] [q]",
214216
checkmark, eventType, selectedEvent.Status)
215217
} else {
216-
eventStatusMsg = fmt.Sprintf("> %s %s succeeded with status %d | [r] Retry • [o] Open in dashboard • [d] Show data",
218+
eventStatusMsg = fmt.Sprintf("> %s %s succeeded with status %d | [r] Retry • [o] Open in dashboard • [d] Show data • [q] Quit",
217219
checkmark, eventType, selectedEvent.Status)
218220
}
219221
} else {
@@ -241,12 +243,12 @@ func (m Model) renderStatusBar() string {
241243
xmark, eventType, selectedEvent.Status)
242244
}
243245
} else {
244-
eventStatusMsg = fmt.Sprintf("> %s %s %s | [r] Retry • [o] Open in dashboard • [d] Show event data",
246+
eventStatusMsg = fmt.Sprintf("> %s %s %s | [r] Retry • [o] Open in dashboard • [d] Show event data • [q] Quit",
245247
xmark, eventType, statusText)
246248
}
247249
}
248250

249-
return statusBarStyle.Render(eventStatusMsg)
251+
return statusBarStyle.Width(m.width).Render(eventStatusMsg)
250252
}
251253

252254
// FormatEventLog formats an event into a log line matching the current style

0 commit comments

Comments
 (0)