Skip to content

Conversation

@yuzawa-san
Copy link
Contributor

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example. see note
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

I was looking over #20963 and enjoy the file size ratios (thanks!). I sometimes run on slow connections and would like some progress bars so I can look at quick glance on how the downloads are going. The prior PR's had no unit tests, and I tested this locally. Here is a video:

progress.mp4

I made sure the bar is 20% (1/5th) of the tty and that it is at least 4 characters long.
I used some unicode box drawing glyphs. I suppose we could use = and - if we want full ASCII support, but the checkmark is already not ASCII, so we should be ok. I am open to feedback on the formatting, sizing, and appearance.

Copilot AI review requested due to automatic review settings December 6, 2025 03:26
Copy link
Contributor

Copilot AI left a comment

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 visual progress bars to concurrent downloads in Homebrew, enhancing the user experience by providing real-time visual feedback on download progress. The implementation calculates the percentage of completion for each download and renders it as a Unicode box-drawing progress bar that occupies approximately 20% of the terminal width.

Key changes:

  • Added progress bar rendering logic that displays download completion percentage using Unicode characters (━ for completed, ┈ for pending)
  • Modified the progress string format to include the progress bar before the phase and size information
  • Removed the square bracket notation from the progress display

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks great so far! Want to give this a better review and test but won't be until Monday. Maintainers: please don't merge until then, thanks!

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks great and worked nicely locally. Only other thing that is tempting is to use a bit more of the possible space if available? With e.g. 100 characters of width the progress bar is pretty cramped.

@yuzawa-san
Copy link
Contributor Author

@MikeMcQuaid i was able to do some analysis of the lengths of the messages based on the extant formula and cask names and versions. 95% of messages will be less than 40-45 characters in length. i selected this since a 80 column terminal will still get a minimal progress bar, while having a low risk of covering the messages. if the message is longer, the bar will shrink. if the terminal is wider, the bar will stretch. i decided to keep the unicode bar style to try to imitate pypi and for readability. it looks clearer that the pure ascii version in my terminal. however, if that ascii version desired i can change that. here is a screenshot in a 80 column terminal
image

and in a 160 column terminal
image

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks for the research! I'd be tempted to say you just fill the entire space if possible based on the maximum length of items already in the queue (because we fully populate it before fetching). I may have missed something here so please correct me if so.

@yuzawa-san
Copy link
Contributor Author

@MikeMcQuaid good idea on finding the max length. i did that and i also updated the bar to be ascii.

60 columns:
image

80 columns:
image

160 columns:
image

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great work, thanks again @yuzawa-san!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 23, 2025
Merged via the queue into Homebrew:main with commit 57817e8 Dec 23, 2025
36 checks passed
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