-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CMM-1081 unify media quota bar with iOS #22449
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
Conversation
Generated by 🚫 Danger |
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22449-7b3f57c | |
| Commit | 7b3f57c | |
| Direct Download | jetpack-prototype-build-pr22449-7b3f57c.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22449-7b3f57c | |
| Commit | 7b3f57c | |
| Direct Download | wordpress-prototype-build-pr22449-7b3f57c.apk |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #22449 +/- ##
==========================================
- Coverage 39.16% 39.14% -0.02%
==========================================
Files 2202 2203 +1
Lines 106560 106604 +44
Branches 15119 15129 +10
==========================================
Hits 41734 41734
- Misses 61328 61372 +44
Partials 3498 3498 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@adalpari Unrelated to this PR, I have a wp.com site with a
WDYT about showing the quota for sites with unlimited media storage, perhaps in a separate PR? The progress bar isn't helpful, but just knowing how much storage you're using might be useful. |
Not sure to follow It would be a small change, so I can do it in this PR |
|
Claude finished @adalpari's task in 2m 31s —— View job Code Review Complete ✅I've conducted a comprehensive review of this PR that adds a visual progress bar to the Media Quota setting. Overall, the implementation is solid and follows established patterns, but I've identified several areas for improvement. ✅ Strengths
🔴 Issues Found1. Line Length Violations (Code Style - High Priority)Location: Multiple lines exceed the 120-character limit specified in Recommendation: Break these lines more aggressively or use local variables to shorten them. See inline comment for example. 2. Deprecated API UsageLocation: The entire class uses the deprecated Recommendation: This is acceptable for now since the entire settings system uses this API, but this should be tracked for future migration to AndroidX Preferences or Jetpack Compose. 3. Missing Null Safety in Layout BindingLocation: The Recommendation: Consider logging a warning or error if required views are null, especially during development. 4. Progress Bar Color Not Explicitly SetLocation: The progress bar relies on default theme colors. For consistency with iOS (as mentioned in the PR title), you should verify the progress indicator color matches the design. Recommendation: Review with design team or explicitly set 5. No Maximum Progress Value SetLocation: The 6. Missing Edge Case Handling (Important)Location: The code doesn't handle the edge case shown in the PR comments where a site has unlimited storage. The progress bar will show 100% filled, which is misleading. See inline comment for suggested approach.
|
WordPress/src/main/java/org/wordpress/android/ui/prefs/QuotaPreference.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/prefs/QuotaPreference.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/prefs/QuotaPreference.kt
Show resolved
Hide resolved
I think just add a check for Update: It just occurred to me that if we make this change, we should avoid showing the long-press toast for unlimited plans. |
False positive
This is a knos fact, but since we are working with old preferences, it0s out of scope to refactor them
We want it to follow the theme colours. So, no color change is needed.
I don't think this isnecessary.
Fixed! |
Done! Can you check it? |
The quota is now being shown for unlimited plans, but the long-press hint still appears. It looks like that's being set here. |
Ahh, good catch! Let me see how I can solve it |
|
nbradbury
left a comment
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.
Changes are good! ![]()






Description
Add a visual progress bar to the Media Quota setting in Site Settings to follow the iOS UI. The quota preference now displays both the text summary (e.g., "50% of 3 GB") and a
LinearProgressIndicatorshowing the storage usage percentage visually.This change introduces a new
QuotaPreferencecomponent that extends the standard Preference with a custom layout containing title, summary text, and a progress bar.Testing instructions
Media quota progress bar: