Skip to content

fix(cli): erase stale bar rows and keep the run header in a bundle get - #2481

Merged
alpergundogdu merged 1 commit into
mainfrom
fix/progress-stale-rows
Oct 16, 2026
Merged

alpergundogdu merged 1 commit into
mainfrom
fix/progress-stale-rows

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #2480. Its in-place redraw has two gaps in indicatif 0.18, both visible in a bundle decdn get:

  • Stale rows. When the stack shrinks (a finished file's bar clears), the rows it no longer covers are never erased, so old total lines pile up under the live stack. The container is now bottom-aligned, so a shrunk stack pads its top with blank lines, and a small TermLike wrapper over buffered stderr (ErasingStderr) erases each padding row as it writes it. A non-terminal stderr keeps indicatif's own stderr target, so bars stay hidden there.
  • Lost header. The run header, printed with println before any bar exists, gets overwritten by the first bar. It now goes out through suspend with its own newline.

console 0.16 becomes a direct dependency; it is already in the tree under indicatif.

One side effect: indicatif picks bar colours from stdout's colour support for a TermLike target, so with stdout piped (-o -) the bars render uncoloured.

Test plan

  • Reproduced both issues in tmux with a small indicatif 0.18.6 program that grows the stack, clears four bars and grows it again. With this setup the stack stays clean and the header stays.
  • cargo clippy -p decdn-cli --all-targets -- -D warnings, cargo fmt --check
  • cargo test -p decdn-cli progress
  • A real bundle decdn get in a tmux pane

🤖 Generated with Claude Code

The in-place redraw from #2480 has two gaps in indicatif 0.18:

- When the stack shrinks (a finished file's bar clears), the rows it no
  longer covers are never erased, so old total lines pile up under it.
  The container is now bottom-aligned, so a shrunk stack pads its top
  with blank lines, and its draw target erases each padding row as it
  writes it.
- The run header, printed with println before any bar exists, is
  overwritten by the first bar. It now goes out through suspend with
  its own newline.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 13:26
@alpergundogdu
alpergundogdu merged commit cc3c646 into main Oct 16, 2026
32 checks passed
@alpergundogdu
alpergundogdu deleted the fix/progress-stale-rows branch October 16, 2026 13:27

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.

🔵 Needs a closer look

Correctness rests on indicatif 0.18's internal terminal draw behavior and visual output that cannot be verified in this environment, and the author left the real-terminal manual check unchecked, so final human visual verification is warranted.

0 open findings

What changed in this PR

This is a follow-up to #2480. That PR switched the CLI's bundle decdn get progress stack to an in-place redraw (set_move_cursor(true)) to stop flicker, but introduced two regressions in indicatif 0.18: (1) when the bar stack shrinks, rows it no longer covers are never erased and pile up as stale total lines; and (2) the run header printed via MultiProgress::println is overwritten by the first bar. This PR fixes both by bottom-aligning the stack and wrapping buffered stderr in an ErasingStderr TermLike that clears each row before writing, and by emitting the header through suspend(|| eprintln!(...)).

Changes:

  • Add a bottom-aligned, in-place draw target backed by ErasingStderr (a TermLike over console::Term::buffered_stderr()) for terminal stderr; non-terminal stderr keeps indicatif's auto-hiding stderr target.
  • Emit the run header through MultiProgress::suspend + eprintln! so the first bar no longer overwrites it.
  • Promote console 0.16 to a direct dependency (already in the tree under indicatif).
File Description
crates/​cli/​src/​logging.rs Adds new_container terminal branch with term_like_with_hz, bottom alignment, the ErasingStderr TermLike wrapper, and the REFRESH_HZ constant.
crates/​cli/​src/​commands/​pull_progress.rs Replaces mp.println(header) with `mp.suspend(
crates/​cli/​Cargo.toml Declares the console workspace dependency for decdn-cli.
Cargo.toml Adds console = "0.16" to [workspace.dependencies].
Cargo.lock Records the new console 0.16.6 edge for decdn-cli.

🧠 Review effort: Balanced


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

alpergundogdu added a commit that referenced this pull request Oct 16, 2026
)

#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]>
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