Repository navigation
fix(cli): keep a bundle get's bar stack anchored under its header - #2483
Conversation
#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]>
There was a problem hiding this comment.
🟢 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) andPadRow(a file bar's row claim, released onfinished()or drop) topull_progress.rs, wired intoInnerandFileBar;FileBar.rowis declared first so the row is handed to the pad before the bar's own drop clears it. - Simplify
logging::new_containerback to a plain top-alignedMultiProgress, removingErasingStderr,REFRESH_HZ, and bottom alignment. - Remove the now-unused direct
consoledependency from the workspace manifest, the CLI manifest, andCargo.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.
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.
FileBarholds aPadRow, released onfinished()or on drop (a pull stopped early). It is declared first so it is released before the bar's own drop clears it.ErasingStderrand the directconsoledependency 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
pad_holds_the_rows_cleared_file_bars_free_until_new_bars_take_themcargo clippy -p decdn-cli --all-targets -- -D warnings,cargo fmt --check,cargo test -p decdn-cli progress(17 passed)decdn getrecording🤖 Generated with Claude Code