Skip to content

iOS: Respect Auto-Play Animated Images setting#2182

Open
ganidande905 wants to merge 2 commits intozulip:mainfrom
ganidande905:iOS_accessibility
Open

iOS: Respect Auto-Play Animated Images setting#2182
ganidande905 wants to merge 2 commits intozulip:mainfrom
ganidande905:iOS_accessibility

Conversation

@ganidande905
Copy link
Copy Markdown

Overview - Fixes #1924

This PR updates ImageAnimationMode.shouldAnimate to respect the iOS 17+ accessibility setting Auto-Play Animated Images, using Flutter’s AccessibilityFeatures.autoPlayAnimatedImages.

What changed

  • Replace the iOS-specific gating that used reduceMotion with a check on autoPlayAnimatedImages (the setting intended for animated images/GIFs).

Testing

  • Verified on iOS that uploaded GIFs/attachments (rendered via ZulipImage) stop animating when Auto-Play Animated Images is disabled, and animate when enabled.

Edge case / follow-up

  • GIFs displayed via pasted URLs in message content still auto-play. That path doesn’t appear to consult ImageAnimationMode, so it bypasses this check. Handling inline URL GIFs would likely require threading ImageAnimationMode (or equivalent gating) into the inline image/link-preview renderer, which seems out of scope for this issue.

Screen Recording

The screen recording demonstrates the behaviour of animated images with the iOS Auto-Play Animated Images accessibility setting:

  • Inline GIFs from pasted URLs (top two examples) and uploaded GIFs both animate normally when the setting is enabled.
  • When Auto-Play Animated Images is disabled, animated images rendered via ZulipImage (including uploaded GIFs) stop animating.
    Inline GIFs from pasted URLs are included in the recording to show current behaviour; however, that rendering path does not consult ImageAnimationMode, so it does not yet respect the setting (as noted in the edge-case section above).
Screen.Recording.Feb.26.2026.1.1.mov

@ganidande905
Copy link
Copy Markdown
Author

@chrisbobbe Could you please review this when convenient? The PR follows the contribution guidelines and all CI checks are passing. Thanks

@chrisbobbe
Copy link
Copy Markdown
Collaborator

Please remove the unrelated code formatting changes.

@ganidande905 ganidande905 force-pushed the iOS_accessibility branch 2 times, most recently from f41e6d8 to 722df08 Compare February 28, 2026 16:31
@ganidande905
Copy link
Copy Markdown
Author

@chrisbobbe I’ve removed the unrelated formatting changes and kept the diff limited to the intended logic change. Please let me know if this looks good now.

@chrisbobbe
Copy link
Copy Markdown
Collaborator

chrisbobbe commented Mar 4, 2026

Please update your commit message to match our style (it's missing a properly-formatted issue reference) and add a test for this new logic; see the project README.

It looks like the feature is new in iOS 17. What behavior do we offer users on older iOS versions? The earliest we support is 15.0 (from ios/Podfile). Probably falling back to that reduce-motion setting would be a reasonable behavior. We should also include test coverage for that case.

@chrisbobbe chrisbobbe self-requested a review March 4, 2026 00:42
@chrisbobbe chrisbobbe self-assigned this Mar 4, 2026
@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Mar 4, 2026
@ganidande905
Copy link
Copy Markdown
Author

I’ll update the commit message and add tests for the new logic.
I’ll also update the implementation so that:

  • iOS 17+ respects autoPlayAnimatedImages
  • iOS 15–16 fall back to reduceMotion
    I’ll push an updated commit shortly.

Fixes zulip#1924.

Update ImageAnimationMode.shouldAnimate to respect the iOS
"auto-play animated images" accessibility setting and reduce
motion when determining whether images should animate.
Add widget tests covering ImageAnimationMode.shouldAnimate
behavior when animations are disabled via MediaQuery and
iOS accessibility settings.
@ganidande905
Copy link
Copy Markdown
Author

Hi! I've pushed the latest changes addressing the feedback and updated the tests as well. Could you please take a look at the updated commits when you have time? Thanks!

@gnprice
Copy link
Copy Markdown
Member

gnprice commented Mar 31, 2026

Thanks. Before we can fully review this PR, you'll need to revise it to have clear and coherent commits. See the resources linked from our README.

Pay attention also to making the code look and work similarly to existing code in the codebase. For example, note what our README says about check vs. expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: Respect "Auto-Play Animated Images" setting, available on iOS 17+

3 participants