Skip to content

Conversation

@MarcelCoding
Copy link
Member

Motivation

I've also implemented the changes from #14364 for the progress bar now.

Although it works, I am not quite happy with it.

If I copy something big from one host to another, the total size will probably be >1GiB. The problem now is that the current progress stays as 0 for way too long because the already transferred bytes are still below 0.1GiB.

2025-10-30_09-54

and after like 10 seconds it looks like that:

2025-10-30_09-59

This problem could be fixed by not displaying the unit only once for a X/X/X GiB block, but instead for every block: X GiB/ X GiB/X GiB.

In the reality, this could look like this: 100KiB/25MiB/1GiB. But I am afraid this could be too verbose.

Maybe the community or maintainers could express some kind of opinion in the direction this should be going.

Also, this could just be a me-problem, because I am expecting that the number is always changing because it was like that till now.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium
Copy link
Contributor

In the reality, this could look like this: 100KiB/25MiB/1GiB

I like this in general. If the units are the same we could skip intermediate units though and keep the last one. That would make things less verbose and reduce duplication.

@MarcelCoding
Copy link
Member Author

MarcelCoding commented Nov 1, 2025

@xokdvium I've just implemented your suggestion:

2025-11-01_18-15 2025-11-01_18-18

I kind of dislike that it is still kind too quiet. How about adding some kind of spinner like with npm or pnpm that indicates that nix is not frozen and still working?

@xokdvium
Copy link
Contributor

xokdvium commented Nov 1, 2025

kind of spinner like with npm or pnpm

Sounds great! That could be a separate PR if you'd like.

throw UsageError("'%s' is not an integer", s);
}

size_t getSizeUnit(int64_t value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we maybe add an enum for the unit? Something like enum class SizeUnit

Copy link
Member Author

Choose a reason for hiding this comment

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

like its implemented now?

@MarcelCoding MarcelCoding force-pushed the progress-bar-units branch 2 times, most recently from 35e1301 to ba9fd9b Compare November 2, 2025 02:10
@MarcelCoding MarcelCoding force-pushed the progress-bar-units branch 2 times, most recently from 5b07a5d to db9a922 Compare November 2, 2025 14:49
@MarcelCoding MarcelCoding force-pushed the progress-bar-units branch 2 times, most recently from 958bcb5 to 3a081b6 Compare November 2, 2025 16:11
@Mic92
Copy link
Member

Mic92 commented Nov 6, 2025

@xokdvium good to go?

Copy link
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

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

Sounds good. Not a huge fan of the amount of duplication, but that can get cleaned up another time.

@MarcelCoding
Copy link
Member Author

I've tried to implement it in the first function, but I've failed and just hardcoded the unit in a copy of the function.

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.

3 participants