From 3d28c521044a39594683989f96bc4dd98f5fb910 Mon Sep 17 00:00:00 2001 From: Charlie Andrews Date: Tue, 15 Mar 2022 11:47:10 -0400 Subject: [PATCH] Mark codespace with pending op as disabled with reason instead of state --- pkg/cmd/codespace/list.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/codespace/list.go b/pkg/cmd/codespace/list.go index 17c7b6414..43eeb74e4 100644 --- a/pkg/cmd/codespace/list.go +++ b/pkg/cmd/codespace/list.go @@ -89,10 +89,22 @@ func (a *App) List(ctx context.Context, limit int, exporter cmdutil.Exporter) er formattedName := formatNameForVSCSTarget(c.Name, c.VSCSTarget) - tp.AddField(formattedName, nil, cs.Yellow) + var nameColor func(string) string + switch c.PendingOperation { + case false: + nameColor = cs.Yellow + case true: + nameColor = cs.Gray + } + + tp.AddField(formattedName, nil, nameColor) tp.AddField(c.Repository.FullName, nil, nil) tp.AddField(c.branchWithGitStatus(), nil, cs.Cyan) - tp.AddField(c.State, nil, stateColor) + if c.PendingOperation { + tp.AddField(c.PendingOperationDisabledReason, nil, cs.Gray) + } else { + tp.AddField(c.State, nil, stateColor) + } if tp.IsTTY() { ct, err := time.Parse(time.RFC3339, c.CreatedAt)