Skip to content

fix(storage): size clear-cache spinners via AppActivityIndicator.size - #223

Merged
iebb merged 1 commit into
iebb:masterfrom
TiaraBasori:fix/clear-cache-loading-animation
Oct 15, 2026
Merged

iebb merged 1 commit into
iebb:masterfrom
TiaraBasori:fix/clear-cache-loading-animation

Conversation

@TiaraBasori

Copy link
Copy Markdown
Contributor

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 default AppActivityIndicator() (size = 26, default color linkBlue) inside a tight SizedBox (15×15 and 14×14 respectively) instead of passing size and color to AppActivityIndicator:

  • AppActivityIndicator centers Transform.rotate on the outer RenderBox size (15×15 / 14×14), while the child Icon inside RenderParagraph still paints its 26px glyph anchored at (0, 0), so the 26px glyph rotated around (7.5, 7.5) / (7, 7) instead of its own (13, 13) center — visibly orbiting off-center inside the button.
  • The spinner also fell back to context.colors.linkBlue instead of matching the destructive action button's foreground (AppTheme.tagRed / actionColor).

Pass size: 15, color: actionColor in _StorageActionCard and size: 14, color: AppTheme.tagRed in _StorageManagerView directly to AppActivityIndicator, removing the tight SizedBox wrappers. 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.

  • Compliant/unchanged: this change complies with applicable Telegram API Terms, preserves Telegram's basic functionality, and does not introduce behavior covered by section 1.4.
  • Section 1.4 exception: the entire feature is guarded by allowTelegramTosViolations (I_DONT_FUCKING_CARE_ABOUT_TOS), disabled in official builds, and available only in an explicitly enabled self-build.
  • Disallowed or unresolved: this PR must not be approved or merged until its classification and implementation are resolved.

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.

  • I reviewed the diff for correctness, unintended behavior, secrets, and unrelated changes.
  • Formatting passed, or I recorded why it is inapplicable: dart format --output=none --set-exit-if-changed lib test integration_test test_driver.
  • Analysis passed, or I recorded why it is inapplicable: flutter analyze.
  • Relevant tests passed, or I recorded why they are inapplicable; name the commands and test cases below. Quality CI runs flutter test --concurrency=4.
  • I checked affected build/platform paths and applicable localization/generated files; list the evidence below.
  • I completed the Terms classification above and verified that official builds cannot enable section 1.4 exceptions.

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 center and storage manager clear selected spinner sizes its icon to the indicator and rotates in place, both proven failing on the pre-fix head with Expected: <15> Actual: <26.0> and Expected: <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): OK
  • python3 translations/tools/gen_assets.py --check → 9 locale assets are up to date
  • python3 tool/gen_registration_anchors.py --check → 0

Section 1.4 exception checks

Not applicable

  • All UI, routes, commands, callbacks, background work, TDLib/native effects, and registrations use the compile-time guard; a runtime preference alone cannot enable the feature.
  • With the flag omitted, the feature is absent and ordinary Telegram behavior remains intact, including with old saved settings.
  • With --dart-define=I_DONT_FUCKING_CARE_ABOUT_TOS=false, the feature is absent and ordinary Telegram behavior remains intact.
  • With --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.
  • Official release, nightly, TestFlight, and store builds keep the flag false and 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.

  • I independently confirmed the Terms classification and inspected all required guards and evidence.
  • Applicable checks and Quality CI pass; no unresolved classification or unguarded section 1.4 behavior remains.

@iebb iebb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@iebb
iebb merged commit f311e34 into iebb:master Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants