Skip to content

fix(cli): keep a bundle get's bar stack anchored under its header - #2483

Merged
alpergundogdu merged 1 commit into
mainfrom
fix/progress-top-anchored
Oct 16, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
fix/progress-top-anchored

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #2481. Bottom alignment kept stale rows from piling up, but as files finish it fills blank rows in at the top, so the bars slide down the screen.

  • A blank pad bar under the total now holds the stack's height. It gains a row before a file bar clears and gives one back after a new bar is inserted, so no frame draws a shorter stack and no stale rows are left below. Its blank lines are written full width, so they overwrite whatever a taller stack left there.
  • Each FileBar holds a PadRow, released on finished() or on drop (a pull stopped early). It is declared first so it is released before the bar's own drop clears it.
  • The container goes back to plain top alignment with indicatif's own stderr target. ErasingStderr and the direct console dependency are removed, along with fix(cli): erase stale bar rows and keep the run header in a bundle get #2481's side effect of uncoloured bars when stdout is piped.

Test plan

  • Checked with a small indicatif 0.18.6 program in tmux that grows the stack, clears four bars and grows it again: the stack stays under the header with nothing stale below.
  • New unit test pad_holds_the_rows_cleared_file_bars_free_until_new_bars_take_them
  • cargo clippy -p decdn-cli --all-targets -- -D warnings, cargo fmt --check, cargo test -p decdn-cli progress (17 passed)
  • A real bundle decdn get recording

🤖 Generated with Claude Code

#2481 bottom-aligned the stack so a shrunk stack's blank padding rows
overwrote the rows it left, which slides the bars down the screen as
files finish. A blank pad bar under the total now holds the stack's
height instead: it gains a row before each file bar clears and gives
one back after each new bar is inserted, so the stack stays at the top
and never shrinks. The top alignment needs no custom draw target, so
ErasingStderr and the direct console dependency go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:11
@alpergundogdu
alpergundogdu merged commit b1bb14a into main Oct 16, 2026
33 checks passed
@alpergundogdu
alpergundogdu deleted the fix/progress-top-anchored branch October 16, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is a small, well-tested CLI progress-rendering fix with correct drop-ordering and row accounting, a clean dependency removal, and no protocol, contract, or economic impact.

0 open findings

What changed in this PR

This PR is a follow-up to #2481 that fixes bar-stack positioning for a bundle decdn get. The prior bottom-alignment approach caused finished-file rows to be filled in at the top, making the live bars slide down the screen. This change replaces that approach with a blank pad bar placed under the total bar: it absorbs a row each time a file bar clears and releases one when a new bar is inserted, so the stack never draws a shorter frame and leaves no stale rows below. The container reverts to plain top alignment with indicatif's native stderr target, and the custom ErasingStderr wrapper plus the direct console dependency are removed (also dropping #2481's side effect of uncolored bars when stdout is piped).

Changes:

  • Add PadBar (stack-height holder) and PadRow (a file bar's row claim, released on finished() or drop) to pull_progress.rs, wired into Inner and FileBar; FileBar.row is declared first so the row is handed to the pad before the bar's own drop clears it.
  • Simplify logging::new_container back to a plain top-aligned MultiProgress, removing ErasingStderr, REFRESH_HZ, and bottom alignment.
  • Remove the now-unused direct console dependency from the workspace manifest, the CLI manifest, and Cargo.lock; add a unit test for the pad row accounting.
File Description
crates/​cli/​src/​commands/​pull_progress.rs Adds PadBar/PadRow, threads the pad through Inner/FileBar, and updates insert/finish/drop paths to keep stack height stable.
crates/​cli/​src/​commands/​pull_progress/​tests.rs New test verifying the pad holds cleared rows until new bars reclaim them, plus early-drop handling.
crates/​cli/​src/​logging.rs Reverts the container to plain top alignment and removes ErasingStderr and the custom draw target.
crates/​cli/​Cargo.toml Drops the direct console dependency.
Cargo.toml Removes the console workspace dependency entry.
Cargo.lock Removes console from decdn-cli's dependency list.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants