Repository navigation
fix(storage): size clear-cache spinners via AppActivityIndicator.size - #223
Conversation
iebb
left a comment
There was a problem hiding this comment.
Reviewed the actual diff and head daa1de4 against current origin/master ae3bc0e.
This is a narrowly scoped rendering fix: pass the 15px/14px glyph size and existing action foreground directly to the owned AppActivityIndicator. The extracted actionColor is the same expression previously used by the button label. Cache-clearing handlers, confirmation flow, TDLib requests, file/account ownership, and storage schemas are unchanged. No Material/Cupertino component or asset is introduced.
- I independently confirmed the completed checklist and Terms classification: compliant/unchanged. There are no new Telegram effects or Section 1.4 features; exception checks are not applicable. Official build settings are unchanged.
- Applicable checks and Quality CI pass; no unresolved classification or unguarded Section 1.4 behavior remains.
Independent validation used a tracked-source-only snapshot with secrets_example.dart:
- Reproduced both new regression failures against byte-identical master production source: expected icon sizes 15 and 14, actual 26.0. Restored the submitted source byte-identically before validating the fix.
- Four focused suites (storage_usage_view, data_storage_surface_style, radius_scale, data_storage_service): 11 passed, including the pending-operation size/color/rotation tests and existing confirmation/request assertions.
- Full unit/widget suite on exact intended merged tree 2b6dd3f0ce56f0d826763ffdb2859f9853497c5c: 3,440 passed, one existing skip.
- Full formatting check: 997 files, zero changes. Full flutter analyze --no-pub: no issues.
- Localization, generated assets, visible-string and registration-anchor checks: clean; 8 locales x 3,829 keys and 9 locale assets.
- Quality CI for this exact head passed: https://github.com/iebb/mithka/actions/runs/38813889798 .
The affected control is shared Dart rendering; no native/platform build files changed. Evidence is widget/layout validation, not native-device visual QA. Cache-clearing tests use a fake storage service, not real Telegram access or real account/cache deletion. No release/deployment/store actions were performed.
Change
In Settings → Data and Storage, both the dashboard's Clear cache button (
_StorageActionCard) and the storage manager's Clear selected button (_StorageManagerView) wrapped a defaultAppActivityIndicator()(size = 26, default colorlinkBlue) inside a tightSizedBox(15×15and14×14respectively) instead of passingsizeandcolortoAppActivityIndicator:AppActivityIndicatorcentersTransform.rotateon the outerRenderBoxsize (15×15/14×14), while the childIconinsideRenderParagraphstill paints its26pxglyph anchored at(0, 0), so the26pxglyph rotated around(7.5, 7.5)/(7, 7)instead of its own(13, 13)center — visibly orbiting off-center inside the button.context.colors.linkBlueinstead of matching the destructive action button's foreground (AppTheme.tagRed/actionColor).Pass
size: 15, color: actionColorin_StorageActionCardandsize: 14, color: AppTheme.tagRedin_StorageManagerViewdirectly toAppActivityIndicator, removing the tightSizedBoxwrappers. Affects all platforms.Diff (
git show --stat daa1de4c):lib/settings/storage_usage_view.dart(+4 / -11)test/storage_usage_view_test.dart(+135 / -0)Telegram API Terms classification
Follow the contribution and agentic review rules. Select exactly one classification and explain it below.
This is an agentic source-code review classification. Every store version must remain compliant with applicable Telegram API Terms; the guarded-source exception does not apply to store distribution or review.
allowTelegramTosViolations(I_DONT_FUCKING_CARE_ABOUT_TOS), disabled in official builds, and available only in an explicitly enabled self-build.Reason and affected Telegram behavior: Pure UI rendering fix for the activity indicator size and color on the Data and Storage cache-clearing buttons; TDLib requests (
optimizeStorage,getStorageStatisticsFast,getStorageStatistics) and Telegram behavior are unchanged.Basic checks (every PR)
Check each item after verification. If a check is inapplicable, explain why in the evidence below before checking it.
dart format --output=none --set-exit-if-changed lib test integration_test test_driver.flutter analyze.flutter test --concurrency=4.Commands, results, platform/build/UI evidence, and reasons for inapplicable checks:
~/.cache/dart3122/bin/dart format --output=none --set-exit-if-changed lib/settings/storage_usage_view.dart test/storage_usage_view_test.dart→Formatted 2 files (0 changed)PATH=/tmp/flutter-3.44.2/bin:$PATH flutter analyze lib/settings/storage_usage_view.dart test/storage_usage_view_test.dart→No issues found!PATH=/tmp/flutter-3.44.2/bin:$PATH flutter test -j 1 test/storage_usage_view_test.dart test/data_storage_surface_style_test.dart test/radius_scale_test.dart→00:12 +8: All tests passed!(includes 2 new widget regression tests:clear cache spinners size their icon to the indicator and rotate around the button centerandstorage manager clear selected spinner sizes its icon to the indicator and rotates in place, both proven failing on the pre-fix head withExpected: <15> Actual: <26.0>andExpected: <14> Actual: <26.0>).python3 tool/check_l10n_strings.py→No visible UI string literals outside lib/l10n.python3 translations/tools/check.py→8 locales x 3829 keys (11 counted): OKpython3 translations/tools/gen_assets.py --check→9 locale assets are up to datepython3 tool/gen_registration_anchors.py --check→0Section 1.4 exception checks
Not applicable
--dart-define=I_DONT_FUCKING_CARE_ABOUT_TOS=false, the feature is absent and ordinary Telegram behavior remains intact.--dart-define=I_DONT_FUCKING_CARE_ABOUT_TOS=true, the feature works through the guarded entry points in a self-build; I included relevant test and build/UI evidence.falseand have no option that enables it. All store versions remain compliant with applicable Telegram API Terms.Guard locations and evidence for each flag variant: Not applicable
Agentic reviewer confirmation
Agentic code reviewer only: record this confirmation in the PR review or check these boxes before approval.