Skip to content

Commit 0038861

Browse files
committed
Fix history view item
1 parent a012d42 commit 0038861

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

internal/ui/delegate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (d historyItemDelegate) Render(w io.Writer, m list.Model, index int, item l
156156
)
157157

158158
i := item.(*historyItem)
159-
title = i.name
159+
title = i.nameForView
160160
desc = i.path
161161
runAt = i.runAt
162162

internal/ui/item.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (i *testCaseItem) FilterValue() string {
6363
type historyItem struct {
6464
path string
6565
name string
66+
nameForView string // name adjusted for view (e.g., with asterisk for prefix)
6667
isUnresolved bool
6768
runAt string
6869
}
@@ -72,9 +73,14 @@ var _ list.Item = (*historyItem)(nil)
7273
func toHistoryItems(histories *tip.Histories, dateFormat string) []list.Item {
7374
items := make([]list.Item, 0)
7475
for _, h := range histories.Histories {
76+
nameForView := h.TestNamePattern
77+
if h.IsPrefix {
78+
nameForView += "*"
79+
}
7580
item := &historyItem{
7681
path: h.Path,
7782
name: h.TestNamePattern,
83+
nameForView: nameForView,
7884
isUnresolved: h.IsPrefix,
7985
runAt: h.RunAt.Format(dateFormat),
8086
}
@@ -84,5 +90,5 @@ func toHistoryItems(histories *tip.Histories, dateFormat string) []list.Item {
8490
}
8591

8692
func (i *historyItem) FilterValue() string {
87-
return i.name
93+
return i.nameForView
8894
}

0 commit comments

Comments
 (0)