Repository navigation
Conversation
duration_short truncated to whole units, so 4d23h read "4d" and 59m40s could not be told from 59m. It now rounds: half steps below 10 h and 10 d (1.5ч, 2.5д), whole units above, minutes clamped to 59 so the next step is "1h", and 23h45m rolls over to "1d". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves
duration_shortformatting by replacing truncation with human-intuitive mathematical rounding, half-step (0.5) precision for small values, and seamless transitions between units.Motivation & Problem
Previously,
duration_shortused integer truncation (floorbehavior):2h(giving the user the impression that almost an entire hour had vanished).4d.59m 40swas indistinguishable from59m.Key Changes
< 10):0.5step with a period separator (e.g.,1.5h,2.5d,9.5h).3h,6d).>= 10):16h,10d)..min(59)so that the final seconds before 1 hour never show an awkward60mbefore flipping to1h.1drather than displaying24h.Verification & Tests
src/theme_engine/tests.rs(duration_short_precision_scale_and_half_steps) verifying:45s,"now").60s -> 1m,3580s -> 59m).1h,1.5h,2.5h,9.5h,10h,18h,85500s -> 1d).1d,1.5d,2.5d,6.5d,10d).