Skip to content

feat: added header bar during mise install#6022

Merged
jdx merged 1 commit into
mainfrom
prog-header
Aug 14, 2025
Merged

feat: added header bar during mise install#6022
jdx merged 1 commit into
mainfrom
prog-header

Conversation

@jdx

@jdx jdx commented Aug 14, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings August 14, 2025 13:31
cursor[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a header progress bar during the mise install command to provide users with an overview of the overall installation progress across all tools being installed.

Key changes:

  • Introduces a new HeaderReport progress bar component with a specific visual style
  • Modifies the multi-progress report system to support a global header that tracks overall tool installation progress
  • Updates the toolset installation logic to initialize, increment, and finalize the header progress bar

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/ui/progress_report.rs Adds HEADER_TEMPLATE style and HeaderReport struct for the new header progress bar
src/ui/multi_progress_report.rs Refactors singleton pattern and adds header management methods
src/toolset/mod.rs Integrates header progress bar into the tool installation workflow

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


let mpr = Arc::new(Self::new());
*mutex = Some(Arc::downgrade(&mpr));
*guard = Some(mpr.clone());

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

Storing an Arc directly in the static instance creates a memory leak - the MultiProgressReport will never be dropped. Consider keeping the original Weak reference pattern to allow proper cleanup when no other references exist.

Copilot uses AI. Check for mistakes.
Comment thread src/ui/progress_report.rs
impl HeaderReport {
pub fn new(prefix: String) -> HeaderReport {
ui::ctrlc::show_cursor_after_ctrl_c();
let pb = ProgressBar::new(100)

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

The magic number 100 should be defined as a named constant or explained with a comment. It's unclear why the initial length is set to 100 when it gets overridden by set_length().

Suggested change
let pb = ProgressBar::new(100)
// The initial length is arbitrary and will be overridden by set_length().
let pb = ProgressBar::new(DEFAULT_PROGRESS_LENGTH)

Copilot uses AI. Check for mistakes.
Comment thread src/ui/progress_report.rs
fn inc(&self, delta: u64) { self.pb.inc(delta); }
fn set_position(&self, pos: u64) {
self.pb.set_position(pos);
if Some(self.pb.position()) == self.pb.length() {

Copilot AI Aug 14, 2025

Copy link

Choose a reason for hiding this comment

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

This comparison will fail if pb.length() returns None. Use self.pb.length().map_or(false, |len| self.pb.position() == len) to handle the case where length is not set.

Suggested change
if Some(self.pb.position()) == self.pb.length() {
if self.pb.length().map_or(false, |len| self.pb.position() == len) {

Copilot uses AI. Check for mistakes.
cursor[bot]

This comment was marked as outdated.

@jdx jdx force-pushed the prog-header branch 2 times, most recently from 71c90f6 to 22e6f4d Compare August 14, 2025 13:47
@github-actions

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.8.9 x -- echo 18.7 ± 0.4 18.0 21.8 1.00
mise x -- echo 18.9 ± 0.3 18.3 20.3 1.01 ± 0.03

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.8.9 env 18.3 ± 0.6 17.5 22.6 1.00
mise env 18.3 ± 0.4 17.7 19.9 1.00 ± 0.04

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.8.9 hook-env 17.7 ± 0.3 17.1 18.8 1.00
mise hook-env 18.2 ± 0.5 17.2 21.0 1.03 ± 0.04

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.8.9 ls 17.4 ± 0.4 16.7 18.7 1.00
mise ls 17.6 ± 0.5 16.7 19.2 1.01 ± 0.03

xtasks/test/perf

Command mise-2025.8.9 mise Variance
install (cached) 168ms ✅ 105ms +60%
ls (cached) 63ms 63ms +0%
bin-paths (cached) 66ms 66ms +0%
task-ls (cached) 486ms 480ms +1%

✅ Performance improvement: install cached is 60%

@jdx jdx merged commit 0134050 into main Aug 14, 2025
17 of 18 checks passed
@jdx jdx deleted the prog-header branch August 14, 2025 14:08
jdx pushed a commit that referenced this pull request Aug 14, 2025
### 📦 Registry

- enable kubecolor test by [@risu729](https://github.com/risu729) in
[#6008](#6008)
- fix os specific backends for usage by
[@risu729](https://github.com/risu729) in
[#6007](#6007)
- use aqua backend for restish by [@risu729](https://github.com/risu729)
in [#5986](#5986)
- add cfssljson
([aqua:cloudflare/cfssl/cfssljson](https://github.com/cloudflare/cfssl/cfssljson))
by [@disintegrator](https://github.com/disintegrator) in
[#6013](#6013)
- add claude-squad
([aqua:smtg-ai/claude-squad](https://github.com/smtg-ai/claude-squad))
by [@TyceHerrman](https://github.com/TyceHerrman) in
[#5894](#5894)

### 🚀 Features

- **(aqua)** make bin paths executable by
[@risu729](https://github.com/risu729) in
[#6010](#6010)
- added header bar during `mise install` by
[@jdx](https://github.com/jdx) in
[#6022](#6022)

### 🐛 Bug Fixes

- **(aqua)** improve warnings for packages without repo_owner and
repo_name (2nd attempt) by [@risu729](https://github.com/risu729) in
[#6009](#6009)
- version prefix detection by [@risu729](https://github.com/risu729) in
[#5943](#5943)
- respect MISE_DEFAULT_CONFIG_FILENAME by
[@risu729](https://github.com/risu729) in
[#5899](#5899)

### New Contributors

- @disintegrator made their first contribution in
[#6013](#6013)
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