-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): Support displaying storage values in base-2 #118
Conversation
A component is used now, so it makes sense to separate the error string logic from the JSX output - Add missing `setBytesStringBase2` field to `UIPreferencesContext` - Update Provider `initialValue` to accept `Partial` (e.g. in test) - Add tests; add missing base-2 cases in `ui.test.ts` - Update the empty error string logic from `sizeWithFailures` to check that all fields are empty: `if (!summ || !summ.errors || !summ.numFailed)` to `if (!summ?.errors?.length && !summ?.numFailed)`
nit: can we collapse the label + value into a dropdown with 2 options:
The rest LGTM modulo linter errors. |
In testing, I'm running into troubles with I've also put together a Feel free to call out if anything looks off. Thank you. |
This PR is obselet with #150. The preferences tab now allows changing the byte representation. Cheers, |
UI functionality in support of #2492 (equivalent PR for CLI: #2502).
bytesStringBase2
option toui-preferences
SizeDisplay
component to pull in configsizeWithFailures
logic from JSXUnits
dropdown to bottomTable
sizeDisplayName
and newgetErrorString
methods to newutils/ui.ts
file, for TypeScript supportQuestions
Curious if there's a more elegant way to create theStorage Unit
label (not familiar with react-bootstrap)Replicated the tests from kopia/units_test.go but I'm not familiar with the<<
syntax in Go to make use of that byte count.Notes
SourcesTable
were not updated to use theSizeDisplay
component.Would like to testSizeDisplay
; I don't have a lot of context onsumm
errors yet.Thanks!