From 79ed590ad6c548eed0212b58724a074b3b22477f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 15:00:53 +0000 Subject: [PATCH] chore: remove dead NewIndeterminateProgressBar function Remove unreachable NewIndeterminateProgressBar from pkg/console/progress.go along with its exclusive test helper nonTTYIndeterminateProgressBar and the two indeterminate subtests in TestGolden_ProgressBarNonTTY. The function has no callers in any non-test binary. The wasm stub in progress_wasm.go is separately build-constrained and untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/console/golden_test.go | 19 ------------------- pkg/console/progress.go | 18 ------------------ 2 files changed, 37 deletions(-) diff --git a/pkg/console/golden_test.go b/pkg/console/golden_test.go index 94c40799b85..40a76a8218d 100644 --- a/pkg/console/golden_test.go +++ b/pkg/console/golden_test.go @@ -325,15 +325,6 @@ func nonTTYProgressBar(total int64) *ProgressBar { return bar } -// nonTTYIndeterminateProgressBar returns an indeterminate ProgressBar in non-TTY -// mode, ensuring tests always take the text-only branch and never call ViewAs on -// the bubbles model. -func nonTTYIndeterminateProgressBar() *ProgressBar { - bar := NewIndeterminateProgressBar() - bar.ttyCheck = func() bool { return false } - return bar -} - // TestGolden_ProgressBarNonTTY tests the deterministic non-TTY outputs of ProgressBar.Update. // These cases are pure and side-effect-free, making them ideal for golden coverage. // ttyCheck is overridden to always return false so the tests run unconditionally, @@ -358,16 +349,6 @@ func TestGolden_ProgressBarNonTTY(t *testing.T) { bar := nonTTYProgressBar(0) golden.RequireEqual(t, []byte(bar.Update(0))) }) - - t.Run("indeterminate_no_data", func(t *testing.T) { - bar := nonTTYIndeterminateProgressBar() - golden.RequireEqual(t, []byte(bar.Update(0))) - }) - - t.Run("indeterminate_with_data", func(t *testing.T) { - bar := nonTTYIndeterminateProgressBar() - golden.RequireEqual(t, []byte(bar.Update(512*1024*1024))) - }) } // TestGolden_InfoSection tests info section rendering diff --git a/pkg/console/progress.go b/pkg/console/progress.go index cdf15f5205f..a57b3051113 100644 --- a/pkg/console/progress.go +++ b/pkg/console/progress.go @@ -70,24 +70,6 @@ func NewProgressBar(total int64) *ProgressBar { } } -// NewIndeterminateProgressBar creates a new progress bar in indeterminate mode -// for use when the total size is not known. The progress bar automatically adapts -// to TTY/non-TTY environments. -func NewIndeterminateProgressBar() *ProgressBar { - progressLog.Printf("Creating indeterminate progress bar") - prog := progress.New( - progress.WithColors(styles.ColorPurple, styles.ColorInfo), - progress.WithScaled(true), - progress.WithWidth(40), - ) - prog.EmptyColor = styles.ColorComment - return &ProgressBar{ - progress: prog, - indeterminate: true, - ttyCheck: isTTY, - } -} - // Update updates the current progress and returns a formatted string // In determinate mode: // - TTY: Returns a visual progress bar with gradient and percentage