-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Feature: Added support for changing the size format #16996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for changing the size format displayed in the app, allowing users to choose between binary and decimal units.
- Introduces a new view model property and corresponding user setting for the size unit format.
- Updates size conversion logic in both view models and utility methods.
- Adds a new enum and updates settings contracts to support the new size format selection.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/Files.App/ViewModels/Settings/FoldersViewModel.cs | Adds SizeUnitsOptions initialization and SizeUnitFormat property for managing size display format. |
src/Files.App/Services/Settings/FoldersSettingsService.cs | Introduces a new SizeUnitFormat property to persist the user’s size format choice. |
src/Files.App/Extensions/StringExtensions.cs | Adjusts size string conversion logic based on the selected size unit format. |
src/Files.App/Data/Models/ByteSize.cs | Updates ShortString to use the appropriate size value based on the user preference. |
src/Files.App/Data/Enums/SizeUnitTypes.cs | Defines the enum representing available size unit formats. |
src/Files.App/Data/Contracts/IFoldersSettingsService.cs | Extends the settings service contract to include SizeUnitFormat. |
Files not reviewed (2)
- src/Files.App/Strings/en-US/Resources.resw: Language not supported
- src/Files.App/Views/Settings/FoldersPage.xaml: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, confirmed working well.
Settings title could be more descriptive maybe?
On my machine, the toggle doesn't immediately refresh the view, causing the page to show units based on the old setting until the user navigates to a new page or manually refresh. |
I clicked the Refresh button to test, wouldnt it b challenging to reflect the change automatically? @yaira2 |
This should be addressed with my latest commit. |
We can technically display an example, but let's see how this works first. |
Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as
Ready to build
. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.