From d9826e0cffe4e69c4dd1ddc5063f6f8955ada7f1 Mon Sep 17 00:00:00 2001 From: Cody Confer Date: Fri, 27 Nov 2026 22:15:37 -0700 Subject: [PATCH] Add star and rocket glyphs --- glyph/glyph.go | 8 ++++++++ glyph/set.go | 6 ++++++ glyph/space_test.go | 25 +++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 glyph/space_test.go diff --git a/glyph/glyph.go b/glyph/glyph.go index 9a03c2b..b4637c6 100644 --- a/glyph/glyph.go +++ b/glyph/glyph.go @@ -144,6 +144,8 @@ var ( user = Variants{"", "◆", ">"} signOut = Variants{"", "⏻", ">"} clock = Variants{"", "◰", ">"} + star = Variants{"", "✦", "*"} + rocket = Variants{"", "🚀", ">"} ) // StatusOK returns the healthy status dot for the current mode. @@ -185,6 +187,12 @@ func Google() string { return google.String() } // Diamond returns the diamond glyph for the current mode. func Diamond() string { return diamond.String() } +// Star returns a star glyph for the current mode. +func Star() string { return star.String() } + +// Rocket returns a rocket glyph for the current mode. +func Rocket() string { return rocket.String() } + // History returns the history/recent-activity glyph for the current mode. func History() string { return history.String() } diff --git a/glyph/set.go b/glyph/set.go index 012be1c..6a4a898 100644 --- a/glyph/set.go +++ b/glyph/set.go @@ -92,6 +92,12 @@ func (g Set) Google() string { return g.of(google) } // Diamond renders the diamond in this set's mode. func (g Set) Diamond() string { return g.of(diamond) } +// Star renders the star glyph in this set's mode. +func (g Set) Star() string { return g.of(star) } + +// Rocket renders the rocket glyph in this set's mode. +func (g Set) Rocket() string { return g.of(rocket) } + // History renders the history icon in this set's mode. func (g Set) History() string { return g.of(history) } diff --git a/glyph/space_test.go b/glyph/space_test.go new file mode 100644 index 0000000..6c390fb --- /dev/null +++ b/glyph/space_test.go @@ -0,0 +1,25 @@ +package glyph + +import "testing" + +func TestStarAndRocketVariants(t *testing.T) { + for _, tc := range []struct { + name string + v Variants + fn func() string + set func(Set) string + want map[Mode]string + }{ + {"star", star, Star, Set.Star, map[Mode]string{ModeNerd: "", ModeUnicode: "✦", ModeNone: "*"}}, + {"rocket", rocket, Rocket, Set.Rocket, map[Mode]string{ModeNerd: "", ModeUnicode: "🚀", ModeNone: ">"}}, + } { + for mode, want := range tc.want { + if got := tc.v.stringIn(mode); got != want { + t.Errorf("%s variant %v = %q, want %q", tc.name, mode, got, want) + } + if got := tc.set(SetFor(mode)); got != want { + t.Errorf("Set.%s variant %v = %q, want %q", tc.name, mode, got, want) + } + } + } +}