on main help sign in
fix(ui): dialog: clarify session age display
commitf14253f1085fe7d5de9559805cddc6e6710835ab authorAyman Bagabas <ayman.bagabas@gmail.com> dateThu 18 Dec 2025, 11:37 (1 year ago) parent45e3310
1 file changed+9−2
internal/ui/dialog/sessions_item.go+9−2
internal/ui/dialog/sessions_item.go+9−2
@@ -86,13 +86,20 @@ func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, w
8686 }
8787
8888 var ageLen int
89+ var right string
90+ lineWidth := width
8991 if updatedAt > 0 {
9092 ageLen = lipgloss.Width(age)
93+ lineWidth -= ageLen
9194 }
9295
93− title = ansi.Truncate(title, max(0, width-ageLen), "…")
96+ title = ansi.Truncate(title, max(0, lineWidth), "…")
9497 titleLen := lipgloss.Width(title)
95− right := lipgloss.NewStyle().AlignHorizontal(lipgloss.Right).Width(width - titleLen).Render(age)
98+
99+ if updatedAt > 0 {
100+ right = lipgloss.NewStyle().AlignHorizontal(lipgloss.Right).Width(width - titleLen).Render(age)
101+ }
102+
96103 content := title
97104 if matches := len(m.MatchedIndexes); matches > 0 {
98105 var lastPos int