summaryrefslogtreecommitdiff
path: root/menu/banner.go
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 19:27:25 +0200
committerewy <ewy0@protonmail.com>2026-04-22 19:27:25 +0200
commit098cae128b18418b0e6be87af5bf29ce2aae39a1 (patch)
treedce7a55ac44296d5803a3d74e0076672bbcd7b33 /menu/banner.go
parentf13b2bcf9a3a5ea6afeaa60c7a2e801e8e79a2c1 (diff)
update script experiment
Diffstat (limited to 'menu/banner.go')
-rw-r--r--menu/banner.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/menu/banner.go b/menu/banner.go
index b65cbbf..33d79d4 100644
--- a/menu/banner.go
+++ b/menu/banner.go
@@ -43,6 +43,9 @@ var (
BannerDryStyle = style.New(func() lipgloss.Style {
return lipgloss.NewStyle().Foreground(BannerDryColor).Bold(true).MarginRight(1)
})
+ BannerDefaultStyle = style.New(func() lipgloss.Style {
+ return lipgloss.NewStyle().Faint(true).MarginLeft(1)
+ })
)
func Banner(source *model.Source, target model.Target, args ...string) string {
@@ -53,7 +56,15 @@ func Banner(source *model.Source, target model.Target, args ...string) string {
parts = append(parts, BannerPromptStyle.Render("> "))
parts = append(parts, BannerSelfStyle.Render("pik"))
parts = append(parts, BannerSourceLabelStyle.Render(source.Label()))
+ def := false
if sub := target.Sub(); sub != nil {
+
+ // remove "default" invocations
+ if sub[len(sub)-1] == target.ShortestId() {
+ sub = sub[:len(sub)-1]
+ def = true
+ }
+
for i, s := range sub {
sub[i] = BannerSubItemStyle.Render(s)
}
@@ -75,6 +86,9 @@ func Banner(source *model.Source, target model.Target, args ...string) string {
parts = append(parts, BannerArgsStyle.Render(argParts...))
}
+ if def {
+ parts = append(parts, BannerDefaultStyle.Render("# "+target.Label()))
+ }
result := BannerStyle.Render(lipgloss.JoinHorizontal(lipgloss.Left, parts...))
return result
}