Skip to content
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

Image Recommendations - Hide feature when VoiceOver is on #4821

Merged
merged 3 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Wikipedia/Code/ExploreFeedSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions Wikipedia/Code/ExploreViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
#if UITEST
presentUITestHelperController()
#endif

presentImageRecommendationsFeatureAnnouncementIfNeeded()
if !UIAccessibility.isVoiceOverRunning {
presentImageRecommendationsFeatureAnnouncementIfNeeded()
}
}

override func viewWillHaveFirstAppearance(_ animated: Bool) {
Expand Down Expand Up @@ -1201,8 +1202,8 @@
func imageRecommendationsUserDidTapInsertImage(viewModel: WKImageRecommendationsViewModel, title: String, with imageData: WKImageRecommendationsViewModel.WKImageRecommendationData) {

guard let siteURL = viewModel.project.siteURL,
let articleURL = siteURL.wmf_URL(withTitle: title),

Check notice on line 1205 in Wikipedia/Code/ExploreViewController.swift

View check run for this annotation

Xcode Cloud / Wikipedia | Run Tests | Test - iOS (Wikipedia)

Wikipedia/Code/ExploreViewController.swift#L1205

Immutable value 'articleURL' was never used; consider replacing with '_' or removing it
let wikitext = imageData.wikitext else {

Check notice on line 1206 in Wikipedia/Code/ExploreViewController.swift

View check run for this annotation

Xcode Cloud / Wikipedia | Run Tests | Test - iOS (Wikipedia)

Wikipedia/Code/ExploreViewController.swift#L1206

Immutable value 'wikitext' was never used; consider replacing with '_' or removing it
return
}

Expand Down
2 changes: 1 addition & 1 deletion Wikipedia/Code/WMFSuggestedEditsContentSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down