Skip to content

Commit

Permalink
feat: update terminal status indicators (#2820)
Browse files Browse the repository at this point in the history
Another option for the progress/complete indicators on the interactive
terminal.

No worries if the other is preferred, I was mostly playing around to see
what we could do here.


https://github.com/user-attachments/assets/d2fc028a-e9b2-4087-b306-28ca0ab82817
  • Loading branch information
wesbillman authored Sep 25, 2024
1 parent fb5c766 commit 98794aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/terminal/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var _ StatusLine = &terminalStatusLine{}
var buildColors map[BuildState]string
var buildStateIcon map[BuildState]func(int) string

var spinner = []string{"", "", "", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃"}
var spinner = []string{"", "", "", ""}

func init() {
buildColors = map[BuildState]string{
Expand All @@ -56,10 +56,10 @@ func init() {
return spinner[spinnerCount]
}
block := func(int) string {
return ""
return ""
}
empty := func(int) string {
return ""
return ""
}
buildStateIcon = map[BuildState]func(int) string{
BuildStateWaiting: empty,
Expand Down Expand Up @@ -204,7 +204,7 @@ func NewStatusManager(ctx context.Context) StatusManager {

go func() {
for !sm.closed.Load() {
time.Sleep(300 * time.Millisecond)
time.Sleep(150 * time.Millisecond)
sm.statusLock.Lock()
if sm.spinnerCount == len(spinner)-1 {
sm.spinnerCount = 0
Expand Down

0 comments on commit 98794aa

Please sign in to comment.