diff --git a/cmd/sw/model.go b/cmd/sw/model.go index 423fe3e..75c13a6 100644 --- a/cmd/sw/model.go +++ b/cmd/sw/model.go @@ -234,14 +234,25 @@ func statusRowView(m model) string { func helpView(m model) string { var hints string - if m.pickingAction { + switch { + case m.pickingAction: hints = "↑↓ navigate • ↩ launch • ← back • / edit URL • q quit" - } else { + case selectedBrowserHasActions(m): hints = "↑↓ navigate • ↩ launch • → actions • / edit URL • q quit" + default: + hints = "↑↓ navigate • ↩ launch • / edit URL • q quit" } return centeredStageRowView(lipgloss.Height(hints), m.styles.helpText.Render(hints)) } +func selectedBrowserHasActions(m model) bool { + selected, ok := m.browserList.SelectedItem().(browserItem) + if !ok { + return false + } + return len(browserscan.ListDesktopActions(selected.id)) != 0 +} + func centeredStageRowView(height int, content string) string { positioned := lipgloss.PlaceHorizontal(stageWidth, lipgloss.Center, content) return lipgloss.NewStyle().