From 2b28ee919614d5ddaceda26ce488a0ca4c851cb3 Mon Sep 17 00:00:00 2001 From: ewy Date: Wed, 29 Apr 2026 01:30:12 +0200 Subject: simplify the contracts --- menu/target.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'menu/target.go') diff --git a/menu/target.go b/menu/target.go index 6d6fdec..e619cbc 100644 --- a/menu/target.go +++ b/menu/target.go @@ -48,7 +48,7 @@ var ( }) ) -func (m *Model) Target(t model.HydratedTarget, header bool) string { +func (m *Model) Target(src *model.HydratedSource, t model.HydratedTarget, header bool) string { _, selection := m.Result() selected := selection != nil && selection.Target() == t.Target() icon := "" @@ -67,12 +67,12 @@ func (m *Model) Target(t model.HydratedTarget, header bool) string { } var labelParts []string labelParts = append(labelParts, icon) - sub := t.Sub() - if sub != nil && sub[len(sub)-1] != t.ShortestId() { + sub := t.Target().Sub() + if sub != nil && sub[len(sub)-1] != t.Target().ShortestId() { labelParts = append(labelParts, TargetSubStyle.Render(sub...)) } - labelParts = append(labelParts, TargetLabelStyle.Render(t.Label())) - return lipgloss.JoinHorizontal(lipgloss.Left, selectionStyle.Render(labelParts...), selectionDescriptionStyle.Render(t.Description())) + labelParts = append(labelParts, TargetLabelStyle.Render(t.Target().Label())) + return lipgloss.JoinHorizontal(lipgloss.Left, selectionStyle.Render(labelParts...), selectionDescriptionStyle.Render(t.Description(src))) } func (m *Model) Category(input string, desc string) string { -- cgit v1.3.1