Repository navigation
Round before picking the unit: storage usage and reset notices - #383
Merged
Merged
Conversation
Settings > storage usage chose KB/MB from the raw byte count and rounded afterwards, so a value just under 1 MB or 1 GB read "1024 KB" or "1024 MB". It now rounds first and moves to the next unit, like size() and traffic() already do. Reset times in quota and key-limit notices truncated, so 1 h 59 min read "about 1 hour" while the menu bar said "2 h" for the same moment. They now round and then pick the unit, the same way resets_in() does. 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What this changes
size()andtraffic()insrc/format.tsalready do.resets_in(). 1 h 59 min now reads "about 2 hours" (was "about 1 hour", while the menu bar said "2 h" for the same moment); 59.5 min reads "about 1 hour"; 23.5 h reads "about 1 day".Same class of bug as #381.
Tests
src/settings/retention.test.ts: units and the two carry-over boundaries.src-tauri/src/notices/tests.rs: the three rounding boundaries; the singular "1 minute" case moved from 90 s to 70 s, since 90 s now rounds to 2 minutes.🤖 Generated with Claude Code