From 1e2a6e894a4a69313853af081fdb8e254c9444f7 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 20 Sep 2024 13:42:01 +1000 Subject: [PATCH] chore: minor adjustments to the status display (#2750) --- internal/status/status.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/status/status.go b/internal/status/status.go index b714641a03..2130fcb710 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -25,6 +25,10 @@ const BuildStateDeploying BuildState = " 🚚️" const BuildStateDeployed BuildState = " ✅️️" const BuildStateFailed BuildState = "💥" +// moduleStatusPadding is the padding between module status entries +// it accounts for the colon, space and the emoji +const moduleStatusPadding = 10 + var _ StatusManager = &terminalStatusManager{} var _ StatusLine = &terminalStatusLine{} @@ -306,7 +310,7 @@ func (r *terminalStatusManager) recalculateLines() { entryLength := 0 keys := []string{} for k := range r.moduleStates { - thisLength := len(k) + 8 + thisLength := len(k) + moduleStatusPadding if thisLength > entryLength { entryLength = thisLength } @@ -322,7 +326,7 @@ func (r *terminalStatusManager) recalculateLines() { if i%perLine == 0 && i > 0 { msg += "\n" } - pad := strings.Repeat(" ", entryLength-len(k)-8) + pad := strings.Repeat(" ", entryLength-len(k)-moduleStatusPadding+2) state := r.moduleStates[k] msg += pad + buildColors[state] + k + ": " + string(state) + "\u001B[39m" }