Skip to content

Add colour to status progress percentage - #14670

Open
hugovk wants to merge 3 commits into
sphinx-doc:masterfrom
hugovk:colour-progress
Open

hugovk wants to merge 3 commits into
sphinx-doc:masterfrom
hugovk:colour-progress

Conversation

@hugovk

@hugovk hugovk commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add more colour to the logs, so the "[XX%]" bit is shown in a different colour based on percentage, from red to green:

reading sources... [ 49%] extdev/nodes
...
writing output... [ 97%] usage/restructuredtext/directives
...
highlighting module code... [100%] sphinxcontrib.websupport.storage
...
copying images... [100%] _static/themes/bizstyle.png

Demo using:

uv run --group docs --no-group package make -C doc clean html

I verified no colour is shown when disabling via env var:

NO_COLOR=1 uv run --group docs --no-group package make -C doc clean html

AI Disclosure

Initial code by Claude, improved by me.

@hugovk

hugovk commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

CI failure unrelated, should be fixed by #14611 or #14669.

@jdillard jdillard added the type:proposal a feature suggestion label Sep 11, 2026
@AA-Turner AA-Turner added type:enhancement enhance or introduce a new feature and removed type:proposal a feature suggestion labels Oct 21, 2026

@jdillard jdillard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. This is non-blocking, but the existing verbosity 0 and verbosity 1 tests strip ANSI escapes, so they don’t guard the new color bands against regressions. I'm not sure if it would be worth adding a focused color assertion, but I’ll leave that judgment to you.

There is also merge conflict at this time, but it looks straightforward to fix.

@timhoffm

Copy link
Copy Markdown
Contributor

I find the color coding a bit confusing. Red to green scales are typically related to quality (was there a warning or error?) not to progress. Would it be more appropriate to introduce progress bars instead?

@jdillard
jdillard self-requested a review October 27, 2026 19:28
@jdillard

Copy link
Copy Markdown
Member

This is a fair point, starting off with a bunch of red could be concerning to a user.

@hugovk

hugovk commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

I've updated it to a scale from grey -> blue -> turquoise -> teal -> green.

How's this look?

@jdillard

jdillard commented Nov 3, 2026

Copy link
Copy Markdown
Member

Since this is UX, I feel like this would be easiest to review with an asciinema demo or similar

@hugovk

hugovk commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Here you go: https://asciinema.org/a/0orjLfcsaUc5MfXj (will be automatically deleted after seven days).

Or download and unzip sphinx-build.cast.zip then:

brew install asciinema # for macOS
asciinema play sphinx-build.cast

Or to test locally:

gh co 14670
uv run --group docs --no-group package make -C doc clean html

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement enhance or introduce a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants