Skip to content

Commit

Permalink
Display remaining time as nonnegative number
Browse files Browse the repository at this point in the history
Currently, the time estimates in our progress bars are displayed as negative numbers, e.g:
Fedora 42 on Koji                          1% [                  ] |   4.9 KiB/s | 854.1 KiB | -03h18m

This formatting makes sense if the user reads it as "the current time is
T minus 3h18m", where T is the time my download will be done. And this
is the convention in some contexts, e.g. rocket launches. But it is not
idiomatic here, where a user is likely to expect the number to mean
"time remaining".

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2332931
Resolves #1963
  • Loading branch information
evan-goode authored and ppisar committed Jan 2, 2025
1 parent a2d0ab6 commit 8751434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdnf5-cli/progressbar/widgets/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ std::string TimeWidget::to_string() const {
ss << format_time(get_bar()->get_elapsed_seconds(), false);
} else {
// in progress -> display remaining time
ss << format_time(get_bar()->get_remaining_seconds(), true);
ss << format_time(get_bar()->get_remaining_seconds(), false);
}
return ss.str();
}
Expand Down

0 comments on commit 8751434

Please sign in to comment.