From 12ce64e56e726b00a3648e37f06c0699f24a044a Mon Sep 17 00:00:00 2001 From: mazevedo Date: Thu, 25 Apr 2024 12:16:49 -0300 Subject: [PATCH] Supress explore feed card, esettings and feature announcement modal for image recs when VoiceOver is on --- Wikipedia/Code/ExploreFeedSettingsViewController.swift | 2 +- Wikipedia/Code/ExploreViewController.swift | 5 +++-- Wikipedia/Code/WMFSuggestedEditsContentSource.m | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Wikipedia/Code/ExploreFeedSettingsViewController.swift b/Wikipedia/Code/ExploreFeedSettingsViewController.swift index 8ed4f70bef0..dc425ed8698 100644 --- a/Wikipedia/Code/ExploreFeedSettingsViewController.swift +++ b/Wikipedia/Code/ExploreFeedSettingsViewController.swift @@ -202,7 +202,7 @@ class ExploreFeedSettingsViewController: BaseExploreFeedSettingsViewController { let continueReading = FeedCard(contentGroupKind: .continueReading, displayType: displayType) let relatedPages = FeedCard(contentGroupKind: .relatedPages, displayType: displayType) let suggestedEdits = FeedCard(contentGroupKind: .suggestedEdits, displayType: displayType) - if FeatureFlags.needsImageRecommendations { + if FeatureFlags.needsImageRecommendations && !UIAccessibility.isVoiceOverRunning { return [inTheNews, onThisDay, featuredArticle, topRead, places, randomizer, pictureOfTheDay, continueReading, relatedPages, suggestedEdits] } else { return [inTheNews, onThisDay, featuredArticle, topRead, places, randomizer, pictureOfTheDay, continueReading, relatedPages] diff --git a/Wikipedia/Code/ExploreViewController.swift b/Wikipedia/Code/ExploreViewController.swift index 94891fbcc0e..5ec8eaca9f3 100644 --- a/Wikipedia/Code/ExploreViewController.swift +++ b/Wikipedia/Code/ExploreViewController.swift @@ -66,8 +66,9 @@ class ExploreViewController: ColumnarCollectionViewController, ExploreCardViewCo #if UITEST presentUITestHelperController() #endif - - presentImageRecommendationsFeatureAnnouncementIfNeeded() + if !UIAccessibility.isVoiceOverRunning { + presentImageRecommendationsFeatureAnnouncementIfNeeded() + } } override func viewWillHaveFirstAppearance(_ animated: Bool) { diff --git a/Wikipedia/Code/WMFSuggestedEditsContentSource.m b/Wikipedia/Code/WMFSuggestedEditsContentSource.m index 7592b7cacff..328fab83afa 100644 --- a/Wikipedia/Code/WMFSuggestedEditsContentSource.m +++ b/Wikipedia/Code/WMFSuggestedEditsContentSource.m @@ -55,7 +55,7 @@ - (void)loadNewContentInManagedObjectContext:(nonnull NSManagedObjectContext *)m [group waitInBackgroundWithCompletion:^{ if (currentUser) { - if ((currentUser.editCount > 50 && !currentUser.isBlocked && hasImageRecommendations) || WMFFeatureFlags.forceImageRecommendationsExploreCard) { + if ((currentUser.editCount > 50 && !currentUser.isBlocked && hasImageRecommendations && !UIAccessibilityIsVoiceOverRunning()) || WMFFeatureFlags.forceImageRecommendationsExploreCard) { NSURL *URL = [WMFContentGroup suggestedEditsURL];