@@ -54,10 +54,11 @@ func (s *SessionItem) SetMatch(m fuzzy.Match) {
55// Render returns the string representation of the session item.
55// Render returns the string representation of the session item.
56func (s *SessionItem) Render(width int) string {
56func (s *SessionItem) Render(width int) string {
57+ info := humanize.Time(time.Unix(s.UpdatedAt, 0))
57− return renderItem(s.t, s.Title, s.UpdatedAt, s.focused, width, s.cache, &s.m)
58+ return renderItem(s.t, s.Title, info, s.focused, width, s.cache, &s.m)
60−func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, width int, cache map[int]string, m *fuzzy.Match) string {
61+func renderItem(t *styles.Styles, title string, info string, focused bool, width int, cache map[int]string, m *fuzzy.Match) string {
61 if cache == nil {
62 if cache == nil {
62 cache = make(map[int]string)
63 cache = make(map[int]string)
@@ -72,23 +73,23 @@ func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, w
72 style = t.Dialog.SelectedItem
73 style = t.Dialog.SelectedItem
75− var age string
76+ var infoText string
76− var ageLen int
77+ var infoLen int
77 lineWidth := width
78 lineWidth := width
78− if updatedAt > 0 {
79+ if len(info) > 0 {
79− age = fmt.Sprintf(" %s ", humanize.Time(time.Unix(updatedAt, 0)))
80+ infoText = fmt.Sprintf(" %s ", info)
80 if focused {
81 if focused {
81− age = t.Base.Render(age)
82+ infoText = t.Base.Render(infoText)
83− age = t.Subtle.Render(age)
84+ infoText = t.Subtle.Render(infoText)
86− ageLen = lipgloss.Width(age)
87+ infoLen = lipgloss.Width(infoText)
89 title = ansi.Truncate(title, max(0, lineWidth), "")
90 title = ansi.Truncate(title, max(0, lineWidth), "")
90 titleLen := lipgloss.Width(title)
91 titleLen := lipgloss.Width(title)
91− gap := strings.Repeat(" ", max(0, lineWidth-titleLen-ageLen))
92+ gap := strings.Repeat(" ", max(0, lineWidth-titleLen-infoLen))
92 content := title
93 content := title
93 if matches := len(m.MatchedIndexes); matches > 0 {
94 if matches := len(m.MatchedIndexes); matches > 0 {
94 var lastPos int
95 var lastPos int
@@ -118,7 +119,7 @@ func renderItem(t *styles.Styles, title string, updatedAt int64, focused bool, w
118 content = strings.Join(parts, "")
119 content = strings.Join(parts, "")
121− content = style.Render(content + gap + age)
122+ content = style.Render(content + gap + infoText)
122 cache[width] = content
123 cache[width] = content
123 return content
124 return content