Skip to content

feat(cli): add expressive interactive renderer with animated progress#75

Merged
ian-pascoe merged 2 commits intomainfrom
opencode/calm-eagle
Feb 26, 2026
Merged

feat(cli): add expressive interactive renderer with animated progress#75
ian-pascoe merged 2 commits intomainfrom
opencode/calm-eagle

Conversation

@ian-pascoe
Copy link
Contributor

Summary

  • add a dedicated CLI renderer module with strict plain vs interactive mode boundaries to keep machine-readable output contracts stable
  • introduce semantic ANSI color styling and operation-specific animated progress indicators for install/upgrade/update/uninstall/self-update flows on TTYs
  • centralize command output through renderer helpers, expand contract-focused tests, and update architecture/install docs for additive interactive behavior

Test Plan

  • rustup run stable cargo fmt --all --check
  • rustup run stable cargo clippy -p crosspack-cli --all-targets -- -D warnings
  • rustup run stable cargo test -p crosspack-cli

@ian-pascoe
Copy link
Contributor Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55c3392b54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1585 to 1588
if result.is_ok() {
progress.set(total_steps);
}
progress.finish();

Choose a reason for hiding this comment

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

P2 Badge Avoid marking failed self-update progress as complete

If run_current_exe_command fails (for example, install resolution/download fails), the code still calls progress.finish(), and finish() renders a line ending in complete in ... for rich mode. That produces a contradictory success-looking completion message immediately before returning an error, which is misleading during incident/debug workflows for interactive users.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adjusted self-update progress completion behavior: the renderer now has separate finish_success() and finish_abandon() paths. run_self_update_command only emits the completion summary on success and clears the progress UI without a success-looking line when the install step fails.

Comment on lines 1571 to 1572
let mut progress = renderer.start_progress("self-update", total_steps);
progress.set(0);

Choose a reason for hiding this comment

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

P3 Badge Prevent overlapping progress bars in self-update

When self-update runs without --registry-root, this function starts a self-update progress bar before it calls run_update_command, and run_update_command now starts its own progress bar too. Because both are active in the same interactive run, their animated draws can interleave and garble terminal output, making step/status messages hard to read.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated self-update sequencing to avoid overlapping progress bars. The self-update progress bar now starts only after the optional nested run_update_command returns, so the nested update bar finishes before self-update progress starts. This removes concurrent animated draws in the same terminal session.

@ian-pascoe ian-pascoe merged commit 2c54222 into main Feb 26, 2026
6 checks passed
@ian-pascoe ian-pascoe deleted the opencode/calm-eagle branch February 26, 2026 19:02
@crosspack-bot crosspack-bot bot mentioned this pull request Feb 26, 2026
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.

1 participant