Complete search section behavior

This commit is contained in:
Joe Julian
2026-03-29 11:21:02 -07:00
parent 48ffa78fa2
commit f39bdcd3be
4 changed files with 240 additions and 1 deletions
+9 -1
View File
@@ -269,6 +269,14 @@ func (u *ui) filteredTitles() []string {
return titles
}
func (u *ui) visiblePathContexts() []string {
paths := make([]string, 0, len(u.visible))
for _, item := range u.visible {
paths = append(paths, u.state.SearchPathContext(item))
}
return paths
}
func (u *ui) selectedEntry() (entry, bool) {
for _, item := range u.visible {
if item.ID == u.state.SelectedEntryID {
@@ -862,7 +870,7 @@ func (u *ui) entryRow(gtx layout.Context, click *widget.Clickable, idx int, item
if strings.TrimSpace(u.search.Text()) == "" {
return layout.Dimensions{}
}
lbl := material.Label(u.theme, unit.Sp(11), strings.Join(item.Path, " / "))
lbl := material.Label(u.theme, unit.Sp(11), u.state.SearchPathContext(item))
lbl.Color = mutedColor
return lbl.Layout(gtx)
}),