From 3d53435babcb255a21f2bbec5970d7a7fde1886d Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:55:29 +1200 Subject: [PATCH 1/8] Format ActivityFormattableContentView before migration --- .../Details/ActivityFormattableContentView.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift index de01a83f381b..92553af29869 100644 --- a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift +++ b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift @@ -57,7 +57,11 @@ struct ActivityFormattableContentView: UIViewRepresentable { super.init() } - func textView(_ textView: UITextView, primaryActionFor textItem: UITextItem, defaultAction: UIAction) -> UIAction? { + func textView( + _ textView: UITextView, + primaryActionFor textItem: UITextItem, + defaultAction: UIAction + ) -> UIAction? { guard case let .link(URL) = textItem.content else { return nil } @@ -67,7 +71,11 @@ struct ActivityFormattableContentView: UIViewRepresentable { } } - func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration? { + func textView( + _ textView: UITextView, + menuConfigurationFor textItem: UITextItem, + defaultMenu: UIMenu + ) -> UITextItem.MenuConfiguration? { if case .link = textItem.content { return nil } From 935d9ec68a0fd116773fdde9aca460f89c177b45 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:55:53 +1200 Subject: [PATCH 2/8] Resolve Activity content link presentation from the local window --- .../Activity/Details/ActivityFormattableContentView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift index 92553af29869..5c6093ac7891 100644 --- a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift +++ b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift @@ -66,8 +66,8 @@ struct ActivityFormattableContentView: UIViewRepresentable { return nil } - return UIAction { [weak self] _ in - self?.routeTo(URL) + return UIAction { [weak self, weak textView] _ in + self?.routeTo(URL, from: textView) } } @@ -83,9 +83,9 @@ struct ActivityFormattableContentView: UIViewRepresentable { return .init(menu: defaultMenu) } - private func routeTo(_ URL: URL) { + private func routeTo(_ URL: URL, from view: UIView?) { // Get the top view controller to create content coordinator - guard let viewController = UIViewController.topViewController else { + guard let viewController = view?.window?.topmostPresentedViewController else { return } From 9d1fc1ae80430dc19d5a9e9e3752bbb85dc9cafe Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:47:52 +1200 Subject: [PATCH 3/8] Format CommentContentTableViewCell before migration --- .../Detail/CommentContentTableViewCell.swift | 112 ++++++++++++------ 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift index d954041bf84f..c4fcd06102de 100644 --- a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift +++ b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift @@ -48,7 +48,8 @@ final class CommentContentTableViewCell: UITableViewCell, NibReusable { private var effectiveDepth: Int = 0 { didSet { guard oldValue != effectiveDepth else { return } - highlightBarLeadingSpacingConstraint.constant = effectiveDepth == 0 ? 0 : (Self.depthInset * CGFloat(effectiveDepth)) + highlightBarLeadingSpacingConstraint.constant = + effectiveDepth == 0 ? 0 : (Self.depthInset * CGFloat(effectiveDepth)) containerStackLeadingConstraint?.constant = (Self.depthInset * CGFloat(effectiveDepth)) + 16 configureDepthSeparators(depth: effectiveDepth) } @@ -177,17 +178,23 @@ final class CommentContentTableViewCell: UITableViewCell, NibReusable { self.isContentExpanded = helper.isCommentExpanded(comment.objectID) self.onContentLoaded = onContentLoaded - viewModel.$state.sink { [weak self] in - self?.configure(with: $0) - }.store(in: &cancellables) + viewModel.$state + .sink { [weak self] in + self?.configure(with: $0) + } + .store(in: &cancellables) - viewModel.$avatar.sink { [weak self] in - self?.configureAvatar(with: $0) - }.store(in: &cancellables) + viewModel.$avatar + .sink { [weak self] in + self?.configureAvatar(with: $0) + } + .store(in: &cancellables) - viewModel.$content.sink { [weak self] in - self?.configureContent($0 ?? "", helper: helper) - }.store(in: &cancellables) + viewModel.$content + .sink { [weak self] in + self?.configureContent($0 ?? "", helper: helper) + } + .store(in: &cancellables) // Configure feature availability. isAccessoryButtonEnabled = comment.isApproved() @@ -198,7 +205,11 @@ final class CommentContentTableViewCell: UITableViewCell, NibReusable { /// - Parameters: /// - comment: The `Comment` object to display. /// - onContentLoaded: Callback to be called once the content has been loaded. Provides the new content height as parameter. - func configureForPostDetails(with comment: Comment, helper: ReaderCommentsHelper, onContentLoaded: ((CGFloat) -> Void)?) { + func configureForPostDetails( + with comment: Comment, + helper: ReaderCommentsHelper, + onContentLoaded: ((CGFloat) -> Void)? + ) { configure(viewModel: CommentCellViewModel(comment: comment), helper: helper, onContentLoaded: onContentLoaded) containerStackLeadingConstraint.constant = 0 @@ -231,7 +242,7 @@ final class CommentContentTableViewCell: UITableViewCell, NibReusable { func configureForCommentDetails() { containerStackView.isLayoutMarginsRelativeArrangement = true - containerStackView.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0) + containerStackView.layoutMargins = UIEdgeInsets(.vertical, 4) } private func configure(with state: CommentCellViewModel.State) { @@ -250,15 +261,18 @@ final class CommentContentTableViewCell: UITableViewCell, NibReusable { depthSeparator?.isHidden = true } for level in 0.. 0 ? "\(likeCount)" : String.noLikes likeButton.accessibilityLabel = { switch likeCount { @@ -478,18 +501,21 @@ private extension CommentContentTableViewCell { } else { wpAssertionFailure("missing configuration") } - likeButton.accessibilityLabel = isLiked ? String(likeCount) + .commentIsLiked : String(likeCount) + .commentIsNotLiked + likeButton.accessibilityLabel = + isLiked ? String(likeCount) + .commentIsLiked : String(likeCount) + .commentIsNotLiked } // MARK: Content Rendering func configureContent(_ content: String, helper: ReaderCommentsHelper) { - let renderer = self.renderer ?? { - let renderer = helper.makeWebRenderer() - renderer.delegate = self - self.renderer = renderer - return renderer - }() + let renderer = + self.renderer + ?? { + let renderer = helper.makeWebRenderer() + renderer.delegate = self + self.renderer = renderer + return renderer + }() renderer.displaySettings = displaySetting @@ -525,7 +551,8 @@ private extension CommentContentTableViewCell { // point hiding a few pixels isContentExpanded = true } - let displayHeight = isContentExpanded ? effectiveContentHeight : min(effectiveContentHeight, Self.maxCollapsedHeight) + let displayHeight = + isContentExpanded ? effectiveContentHeight : min(effectiveContentHeight, Self.maxCollapsedHeight) contentContainerHeightConstraint?.constant = displayHeight @@ -550,9 +577,12 @@ private extension CommentContentTableViewCell { let viewModel = ReaderUserProfileViewModel(comment: comment) let profileVC = UIHostingController(rootView: ReaderUserProfileView(viewModel: viewModel)) let navigationVC = UINavigationController(rootViewController: profileVC) - profileVC.navigationItem.leftBarButtonItem = UIBarButtonItem(systemItem: .close, primaryAction: .init { [weak profileVC] _ in - profileVC?.presentingViewController?.dismiss(animated: true) - }) + profileVC.navigationItem.leftBarButtonItem = UIBarButtonItem( + systemItem: .close, + primaryAction: .init { [weak profileVC] _ in + profileVC?.presentingViewController?.dismiss(animated: true) + } + ) navigationVC.sheetPresentationController?.detents = [.medium()] UIViewController.topViewController?.present(navigationVC, animated: true) } @@ -603,6 +633,12 @@ private extension String { static let likeButtonAccessibilityId = "like-comment-button" static let reply = NSLocalizedString("Reply", comment: "Reply to a comment.") static let noLikes = NSLocalizedString("Like", comment: "Button title to Like a comment.") - static let singularLikeFormat = NSLocalizedString("%1$d Like", comment: "Singular button title to Like a comment. %1$d is a placeholder for the number of Likes.") - static let pluralLikesFormat = NSLocalizedString("%1$d Likes", comment: "Plural button title to Like a comment. %1$d is a placeholder for the number of Likes.") + static let singularLikeFormat = NSLocalizedString( + "%1$d Like", + comment: "Singular button title to Like a comment. %1$d is a placeholder for the number of Likes." + ) + static let pluralLikesFormat = NSLocalizedString( + "%1$d Likes", + comment: "Plural button title to Like a comment. %1$d is a placeholder for the number of Likes." + ) } From 47f03282954ac148edb3df4b868648663d4b3f89 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:48:12 +1200 Subject: [PATCH 4/8] Resolve comment profile presentation from the local window --- .../Comments/Views/Detail/CommentContentTableViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift index c4fcd06102de..951e4338c43e 100644 --- a/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift +++ b/WordPress/Classes/ViewRelated/Comments/Views/Detail/CommentContentTableViewCell.swift @@ -584,7 +584,7 @@ private extension CommentContentTableViewCell { } ) navigationVC.sheetPresentationController?.detents = [.medium()] - UIViewController.topViewController?.present(navigationVC, animated: true) + window?.topmostPresentedViewController?.present(navigationVC, animated: true) } @objc func accessoryButtonTapped() { From 6d56cc43361a4308e65db45638089b678878eade Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:49:33 +1200 Subject: [PATCH 5/8] Format ReaderReadMoreView before migration --- .../Detail/Views/ReaderReadMoreView.swift | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift index 7b461532c119..566bf51b417d 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift @@ -3,7 +3,9 @@ import SafariServices import WordPressData // […] -final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate, UIPopoverPresentationControllerDelegate { +final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate, + UIPopoverPresentationControllerDelegate +{ // swiftlint:disable:this opening_brace private let textView = UITextView.makeLabel() private let infoIconView = UIImageView(image: UIImage(systemName: "info.circle.fill")) private var postURL: URL? @@ -21,9 +23,12 @@ final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate textView.adjustsFontForContentSizeCategory = true textView.isUserInteractionEnabled = false // Ignore taps on a link and disable selection - let string = NSMutableAttributedString(string: Strings.viewFullPost, attributes: [ - .font: UIFont.preferredFont(forTextStyle: .body) - ]) + let string = NSMutableAttributedString( + string: Strings.viewFullPost, + attributes: [ + .font: UIFont.preferredFont(forTextStyle: .body) + ] + ) if let postURL = post.permaLink.flatMap(URL.init) { string.addAttribute(.link, value: postURL, range: NSRange(location: 0, length: string.length)) self.postURL = postURL @@ -72,7 +77,9 @@ final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate popoverVC.view.backgroundColor = .systemBackground popoverVC.view.addSubview(detailsLabel) detailsLabel.pinEdges(insets: UIEdgeInsets(.all, 16)) - popoverVC.preferredContentSize = popoverVC.view.systemLayoutSizeFitting(CGSize(width: preferredWidth, height: 1200)) + popoverVC.preferredContentSize = popoverVC.view.systemLayoutSizeFitting( + CGSize(width: preferredWidth, height: 1200) + ) popoverVC.modalPresentationStyle = .popover popoverVC.popoverPresentationController?.delegate = self @@ -88,7 +95,20 @@ final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate } private enum Strings { - static let viewFullPost = NSLocalizedString("reader.postDetails.viewFullPost", value: "View full post", comment: "Button title") - static let blog = NSLocalizedString("reader.postDetails.blog", value: "blog", comment: "Reader post details view placeholder when blog name not avail") - static let details = NSLocalizedString("reader.postDetails.viewModeDescription", value: "The owner of this site only allows us to show a brief summary of their content. To view the full post, you'll have to visit their site.", comment: "Reader post details view") + static let viewFullPost = NSLocalizedString( + "reader.postDetails.viewFullPost", + value: "View full post", + comment: "Button title" + ) + static let blog = NSLocalizedString( + "reader.postDetails.blog", + value: "blog", + comment: "Reader post details view placeholder when blog name not avail" + ) + static let details = NSLocalizedString( + "reader.postDetails.viewModeDescription", + value: + "The owner of this site only allows us to show a brief summary of their content. To view the full post, you'll have to visit their site.", + comment: "Reader post details view" + ) } From 1be09c42a0a12739855935b1aac49e028bb0b406 Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 20:49:58 +1200 Subject: [PATCH 6/8] Resolve Reader read more presentation from the local window --- .../ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift index 566bf51b417d..75649cd62e5b 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderReadMoreView.swift @@ -60,7 +60,7 @@ final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate return } let safariVC = SFSafariViewController(url: postURL) - UIViewController.topViewController?.present(safariVC, animated: true) + window?.topmostPresentedViewController?.present(safariVC, animated: true) } @objc private func showInfoTapped() { @@ -84,7 +84,7 @@ final class ReaderReadMoreView: UIView, UIAdaptivePresentationControllerDelegate popoverVC.modalPresentationStyle = .popover popoverVC.popoverPresentationController?.delegate = self popoverVC.popoverPresentationController?.sourceView = infoIconView - UIViewController.topViewController?.present(popoverVC, animated: true) + window?.topmostPresentedViewController?.present(popoverVC, animated: true) } // MARK: UIAdaptivePresentationControllerDelegate From 7dde885d1bec7dbd2eb70ed8b4fe0115c524c75a Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 21:17:42 +1200 Subject: [PATCH 7/8] Format ReaderDetailCommentsTableViewDelegate before migration --- ...eaderDetailCommentsTableViewDelegate.swift | 82 +++++++++++++------ 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift index a1173696f797..2ae4f429395f 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift @@ -15,7 +15,7 @@ class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UI private weak var buttonDelegate: BorderedButtonTableViewCellDelegate? private(set) var headerView: ReaderDetailCommentsHeader? private let helper = ReaderCommentsHelper() - var followButtonTappedClosure: (() ->Void)? + var followButtonTappedClosure: (() -> Void)? var buttonLeaveCommentTapped: ((Comment?) -> Void)? var displaySetting: ReaderDisplaySettings @@ -72,11 +72,11 @@ class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UI // MARK: - Table Methods func numberOfSections(in tableView: UITableView) -> Int { - return 1 + 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return items.count + items.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { @@ -93,9 +93,13 @@ class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UI } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { - guard let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: ReaderDetailCommentsHeader.defaultReuseID) as? ReaderDetailCommentsHeader, - let post, - let presentingViewController else { + guard + let header = tableView.dequeueReusableHeaderFooterView( + withIdentifier: ReaderDetailCommentsHeader.defaultReuseID + ) as? ReaderDetailCommentsHeader, + let post, + let presentingViewController + else { return nil } @@ -118,22 +122,24 @@ class ReaderDetailCommentsTableViewDelegate: NSObject, UITableViewDataSource, UI return nil } let textProvider = JetpackBrandingTextProvider(screen: JetpackBadgeScreen.readerDetail) - return JetpackButton.makeBadgeView(title: textProvider.brandingText(), - bottomPadding: Constants.jetpackBadgeBottomPadding, - target: self, - selector: #selector(jetpackButtonTapped)) + return JetpackButton.makeBadgeView( + title: textProvider.brandingText(), + bottomPadding: Constants.jetpackBadgeBottomPadding, + target: self, + selector: #selector(jetpackButtonTapped) + ) } func tableView(_ tableView: UITableView, estimatedHeightForHeaderInSection section: Int) -> CGFloat { - return ReaderDetailCommentsHeader.estimatedHeight + ReaderDetailCommentsHeader.estimatedHeight } func tableView(_ tableView: UITableView, estimatedHeightForFooterInSection section: Int) -> CGFloat { - return ReaderDetailCommentsHeader.estimatedHeight + ReaderDetailCommentsHeader.estimatedHeight } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { - return UITableView.automaticDimension + UITableView.automaticDimension } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { @@ -152,7 +158,9 @@ private extension ReaderDetailCommentsTableViewDelegate { cell.backgroundColor = .clear let leaveCommentView = LeaveCommentView() - leaveCommentView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(leaveCommentCellTapped))) + leaveCommentView.addGestureRecognizer( + UITapGestureRecognizer(target: self, action: #selector(leaveCommentCellTapped)) + ) leaveCommentView.displaySettings = displaySetting cell.contentView.addSubview(leaveCommentView) @@ -162,7 +170,10 @@ private extension ReaderDetailCommentsTableViewDelegate { } func makeCommentCell(for comment: Comment, in tableView: UITableView) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: CommentContentTableViewCell.defaultReuseID) as? CommentContentTableViewCell else { + guard + let cell = tableView.dequeueReusableCell(withIdentifier: CommentContentTableViewCell.defaultReuseID) + as? CommentContentTableViewCell + else { return UITableViewCell() } @@ -192,7 +203,10 @@ private extension ReaderDetailCommentsTableViewDelegate { } func makeEmptyStateCell(title: String, in tableView: UITableView) -> UITableViewCell { - guard let cell = tableView.dequeueReusableCell(withIdentifier: ReaderDetailNoCommentCell.defaultReuseID) as? ReaderDetailNoCommentCell else { + guard + let cell = tableView.dequeueReusableCell(withIdentifier: ReaderDetailNoCommentCell.defaultReuseID) + as? ReaderDetailNoCommentCell + else { return UITableViewCell() } @@ -222,14 +236,20 @@ private extension ReaderDetailCommentsTableViewDelegate { container.font = UIFont.preferredFont(forTextStyle: .headline).withWeight(.medium) return container } - configuration.preferredSymbolConfigurationForImage = UIImage.SymbolConfiguration(paletteColors: [displaySetting.color.tertiatyForeground]) - .applying(UIImage.SymbolConfiguration(font: UIFont.preferredFont(forTextStyle: .caption2).withWeight(.bold))) + configuration.preferredSymbolConfigurationForImage = + UIImage.SymbolConfiguration(paletteColors: [displaySetting.color.tertiatyForeground]) + .applying( + UIImage.SymbolConfiguration(font: UIFont.preferredFont(forTextStyle: .caption2).withWeight(.bold)) + ) configuration.imagePadding = 4 configuration.contentInsets = .init(top: 9, leading: 12, bottom: 9, trailing: 12) - let button = UIButton(configuration: configuration, primaryAction: .init { [weak self] _ in - self?.buttonDelegate?.buttonTapped() - }) + let button = UIButton( + configuration: configuration, + primaryAction: .init { [weak self] _ in + self?.buttonDelegate?.buttonTapped() + } + ) cell.contentView.addSubview(button) @@ -247,7 +267,10 @@ private extension ReaderDetailCommentsTableViewDelegate { } WPAnalytics.track(.readerArticleCommentShared) - let activityViewController = UIActivityViewController(activityItems: [commentURL as Any], applicationActivities: nil) + let activityViewController = UIActivityViewController( + activityItems: [commentURL as Any], + applicationActivities: nil + ) activityViewController.popoverPresentationController?.sourceView = sourceView UIViewController.topViewController?.present(activityViewController, animated: true, completion: nil) } @@ -266,9 +289,18 @@ private extension ReaderDetailCommentsTableViewDelegate { } struct Constants { - static let closedComments = NSLocalizedString("Comments are closed", comment: "Displayed on the post details page when there are no post comments and commenting is closed.") - static let viewAllButtonTitle = NSLocalizedString("View all comments", comment: "Title for button on the post details page to show all comments when tapped.") - static let emptyStateTitle = NSLocalizedString("Be the first to comment", comment: "Title for button on the post details page when there are no comments.") + static let closedComments = NSLocalizedString( + "Comments are closed", + comment: "Displayed on the post details page when there are no post comments and commenting is closed." + ) + static let viewAllButtonTitle = NSLocalizedString( + "View all comments", + comment: "Title for button on the post details page to show all comments when tapped." + ) + static let emptyStateTitle = NSLocalizedString( + "Be the first to comment", + comment: "Title for button on the post details page when there are no comments." + ) static let jetpackBadgeBottomPadding: CGFloat = 10 } } From efb301588bcdcd4230d8e008b075faf737c8768b Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 26 Jun 2026 21:18:16 +1200 Subject: [PATCH 8/8] Resolve comment share presentation from the local window --- .../Detail/Views/ReaderDetailCommentsTableViewDelegate.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift index 2ae4f429395f..3ace6969d3ac 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/Views/ReaderDetailCommentsTableViewDelegate.swift @@ -272,7 +272,8 @@ private extension ReaderDetailCommentsTableViewDelegate { applicationActivities: nil ) activityViewController.popoverPresentationController?.sourceView = sourceView - UIViewController.topViewController?.present(activityViewController, animated: true, completion: nil) + (presentingViewController?.topmostPresentedViewController ?? sourceView?.window?.topmostPresentedViewController)? + .present(activityViewController, animated: true, completion: nil) } @objc private func leaveCommentCellTapped() {