charmbracelet / charmbracelet/bubbles
Feature: Partial block characters for progress bar
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 457
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Description
I noticed that the progress bar uses whole blocks instead of the partial blocks: `▏`, `▎`, `▍`, `▌`, `▋`, `▊`, `▉`
While the Empty character `░` wouldn't really go well with it, using partial blocks does provide for a much cleaner looking progress bar.
Here is an example with a width of 30, cycling through by various delays.

Also, I created a Gist for this a while back showcasing how to basically create a progress bar using these partial blocks, however the gist is a bit old and does not have the color gradient like the Gif example does (but it is pretty straight forward to add). The TL;DR: on how to add support to this is calculate the remainder percent after filling the width with whole blocks, and then getting the remainder percent out of that from the blocks, and using that instead of a whole block.
https://gist.github.com/DeadlySurgeon/4012083474ff4b4ef0fa464417deed9a
I think it would be good that if this is added, it would be opt'd in with something like a `progress.UsePartialBlocks()` option.
Another thing I was playing with (but don't have as an example right now), was having the background be the same color gradient as the bar but darkened, in place of the empty character. This made it look like it was filling out space meant for the colors, but to be honest was a mixed bag with how it looked compared to just having the space be dark grey or just empty.
Contributor guide
Research direction
Start at the progress bar component and inspect how it currently renders whole blocks, using the linked partial-block gist as background. The work is done when partial block characters are available through an opt-in option while existing rendering remains unchanged when the option is not enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100