From 1bd88e031aa7ea057c6baea18cf2c700c975c80d Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 22 Feb 2024 12:19:06 +0200 Subject: [PATCH 1/7] Updates Jetpack banners and badges copy --- .../Jetpack/Branding/JetpackBrandingTextProvider.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift b/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift index c74bc3387bc0..2c54588390ca 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Branding/JetpackBrandingTextProvider.swift @@ -118,11 +118,7 @@ private extension JetpackBrandingTextProvider { static let phaseThreeSingularMovingInText = NSLocalizedString("jetpack.branding.badge_banner.moving_in.singular", value: "%@ is moving in %@", comment: "Title of a badge indicating when a feature in singular form will be removed. First argument is the feature name. Second argument is the number of days/weeks it will be removed in. Ex: Reader is moving in 2 weeks") - static let phaseStaticScreensText = NSLocalizedString( - "jetpack.branding.badge_banner.moving_in_days.plural", - value: "Moving to the Jetpack app in a few days.", - comment: "Title of a badge or banner indicating that this feature will be moved in a few days." - ) + static let phaseStaticScreensText = defaultText } private var isPlural: Bool { From 6b117f9f151c518038952a01ff91a537c1b2e9dc Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Thu, 22 Feb 2024 12:23:41 +0200 Subject: [PATCH 2/7] Adds release note --- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d92667ddc815..21ff565a7f50 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -5,9 +5,9 @@ 24.3 ----- * [***] [internal] Refactored websocket connections to Pinghub. [#22611] - * [**] Multiple pre-publishing sheet fixes and improvements [#22606] * [*] Gravatar: Adds informative new view about Gravatar to the profile editing page. [#22615] +* [*] [internal][WordPress-only] Updates Jetpack banners and badges copy for consistency [#20123] 24.2 ----- From d9e3eb296c769bd4808b91e794ddb3fab24f5e01 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 23 Feb 2024 09:43:44 +1300 Subject: [PATCH 3/7] Update Lottie class in a nib file --- .../JetpackFullscreenOverlayViewController.xib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib b/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib index 88a5ffb9a04f..9697163752ff 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib +++ b/WordPress/Classes/ViewRelated/Jetpack/Branding/Fullscreen Overlay/JetpackFullscreenOverlayViewController.xib @@ -42,7 +42,7 @@ - + From 96e1d7e7fd97698785e9f3768d190ea3e93621bd Mon Sep 17 00:00:00 2001 From: kean Date: Fri, 23 Feb 2024 11:11:12 -0500 Subject: [PATCH 4/7] Fix analytics prepublishing sheet --- .../Post/Prepublishing/PrepublishingViewController.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift index e7d19341b279..e0d8d914d1a1 100644 --- a/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Prepublishing/PrepublishingViewController.swift @@ -224,10 +224,8 @@ final class PrepublishingViewController: UIViewController, UITableViewDataSource navigationController?.setNavigationBarHidden(false, animated: animated) } - if isBeingDismissed || parent?.isBeingDismissed == true { - if !didTapPublish, - post.status == .publishPrivate, - let originalStatus = post.original?.status { + if (isBeingDismissed || parent?.isBeingDismissed == true) && !didTapPublish { + if post.status == .publishPrivate, let originalStatus = post.original?.status { post.status = originalStatus } completion(.dismissed) From 2977316342c4709eaa9962f25df89e8f5dd38ba9 Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:41:20 -0500 Subject: [PATCH 5/7] Use `weak` self over `unowned` --- .../Reader/Detail/ReaderDetailViewController.swift | 9 ++++++--- .../Reader/ReaderCardsStreamViewController.swift | 10 ++++++++-- .../Reader/ReaderSearchViewController.swift | 5 ++++- .../Reader/ReaderStreamViewController.swift | 5 ++++- .../WPTabBarController+ReaderTabNavigation.swift | 10 ++++++++-- 5 files changed, 30 insertions(+), 9 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift index c46b899b82ce..66ffe60ab299 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift @@ -406,8 +406,8 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView { /// Scroll the content to a given #hash /// func scroll(to hash: String) { - webView.evaluateJavaScript("document.getElementById('\(hash)').offsetTop", completionHandler: { [unowned self] height, _ in - guard let height = height as? CGFloat else { + webView.evaluateJavaScript("document.getElementById('\(hash)').offsetTop", completionHandler: { [weak self] height, _ in + guard let self, let height = height as? CGFloat else { return } @@ -577,7 +577,10 @@ class ReaderDetailViewController: UIViewController, ReaderDetailView { } // Load the image - featuredImage.load { [unowned self] in + featuredImage.load { [weak self] in + guard let self else { + return + } self.hideLoading() } } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift index 00b3e6611d04..db08fad5056a 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderCardsStreamViewController.swift @@ -250,7 +250,10 @@ class ReaderCardsStreamViewController: ReaderStreamViewController { // MARK: - Select Interests Display private extension ReaderCardsStreamViewController { func displaySelectInterestsIfNeeded() { - selectInterestsViewController.userIsFollowingTopics { [unowned self] isFollowing in + selectInterestsViewController.userIsFollowingTopics { [weak self] isFollowing in + guard let self else { + return + } if isFollowing { self.hideSelectInterestsView() } else { @@ -291,7 +294,10 @@ private extension ReaderCardsStreamViewController { selectInterestsViewController.view.frame = self.view.bounds self.add(selectInterestsViewController) - selectInterestsViewController.didSaveInterests = { [unowned self] _ in + selectInterestsViewController.didSaveInterests = { [weak self] _ in + guard let self else { + return + } self.hideSelectInterestsView() } } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift index 979f6e7b2917..ffb9842d5ebb 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderSearchViewController.swift @@ -59,7 +59,10 @@ import Gridicons private lazy var bannerView: JetpackBannerView = { let textProvider = JetpackBrandingTextProvider(screen: JetpackBannerScreen.readerSearch) let bannerView = JetpackBannerView() - bannerView.configure(title: textProvider.brandingText()) { [unowned self] in + bannerView.configure(title: textProvider.brandingText()) { [weak self] in + guard let self else { + return + } JetpackBrandingCoordinator.presentOverlay(from: self) JetpackBrandingAnalyticsHelper.trackJetpackPoweredBannerTapped(screen: .readerSearch) } diff --git a/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift b/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift index 60a74f07df8a..8144b9cf9dfc 100644 --- a/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/ReaderStreamViewController.swift @@ -528,7 +528,10 @@ import WordPressUI } let textProvider = JetpackBrandingTextProvider(screen: JetpackBannerScreen.reader) let bannerView = JetpackBannerView() - bannerView.configure(title: textProvider.brandingText()) { [unowned self] in + bannerView.configure(title: textProvider.brandingText()) { [weak self] in + guard let self else { + return + } JetpackBrandingCoordinator.presentOverlay(from: self) JetpackBrandingAnalyticsHelper.trackJetpackPoweredBannerTapped(screen: .reader) } diff --git a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift index 43283d0b79d1..9783b7d32f72 100644 --- a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift +++ b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift @@ -27,7 +27,10 @@ extension WPTabBarController { } @objc func makeReaderTabViewController() -> ReaderTabViewController { - return ReaderTabViewController(viewModel: readerTabViewModel) { [unowned self] viewModel in + return ReaderTabViewController(viewModel: readerTabViewModel) { [weak self] viewModel in + guard let self else { + return ReaderTabView(viewModel: viewModel) + } return self.makeReaderTabView(viewModel) } } @@ -37,7 +40,10 @@ extension WPTabBarController { readerContentFactory: { [unowned self] in self.makeReaderContentViewController(with: $0) }, - searchNavigationFactory: { [unowned self] in + searchNavigationFactory: { [weak self] in + guard let self else { + return + } self.navigateToReaderSearch() }, tabItemsStore: ReaderTabItemsStore(), From 03939ded6ac49ed1ece95d06e02639dd48e0c743 Mon Sep 17 00:00:00 2001 From: Chris McGraw <2454408+wargcm@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:43:27 -0500 Subject: [PATCH 6/7] Replace factory function call with function body --- .../WPTabBarController+ReaderTabNavigation.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift index 9783b7d32f72..de070468cdc9 100644 --- a/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift +++ b/WordPress/Classes/ViewRelated/Reader/Tab Navigation/WPTabBarController+ReaderTabNavigation.swift @@ -37,8 +37,16 @@ extension WPTabBarController { @objc func makeReaderTabViewModel() -> ReaderTabViewModel { let viewModel = ReaderTabViewModel( - readerContentFactory: { [unowned self] in - self.makeReaderContentViewController(with: $0) + readerContentFactory: { [weak self] content in + if content.topicType == .discover, let topic = content.topic { + let controller = ReaderCardsStreamViewController.controller(topic: topic) + controller.shouldShowCommentSpotlight = self?.readerTabViewModel.shouldShowCommentSpotlight ?? false + return controller + } else if let topic = content.topic { + return ReaderStreamViewController.controllerWithTopic(topic) + } else { + return ReaderStreamViewController.controllerForContentType(content.type) + } }, searchNavigationFactory: { [weak self] in guard let self else { From 04a78bc881ee3d8f40f5fc8ebfdc03e7da68e013 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Wed, 28 Feb 2024 15:50:31 +1100 Subject: [PATCH 7/7] Update strings for localization --- WordPress/Resources/en.lproj/Localizable.strings | 3 --- 1 file changed, 3 deletions(-) diff --git a/WordPress/Resources/en.lproj/Localizable.strings b/WordPress/Resources/en.lproj/Localizable.strings index 4c676217bbfc..5c436b79fbaa 100644 --- a/WordPress/Resources/en.lproj/Localizable.strings +++ b/WordPress/Resources/en.lproj/Localizable.strings @@ -4495,9 +4495,6 @@ Example: Reply to Pamela Nguyen */ /* Title of a badge indicating when a feature in singular form will be removed. First argument is the feature name. Second argument is the number of days/weeks it will be removed in. Ex: Reader is moving in 2 weeks */ "jetpack.branding.badge_banner.moving_in.singular" = "%1$@ is moving in %2$@"; -/* Title of a badge or banner indicating that this feature will be moved in a few days. */ -"jetpack.branding.badge_banner.moving_in_days.plural" = "Moving to the Jetpack app in a few days."; - /* Title of a badge indicating that a feature in plural form will be removed soon. First argument is the feature name. Ex: Notifications are moving soon */ "jetpack.branding.badge_banner.moving_soon.plural" = "%@ are moving soon";