Skip to content

Conversation

@crazytonyli
Copy link
Contributor

@crazytonyli crazytonyli commented Dec 10, 2025

Description

It should be straightforward to review commits by commit.

You can test by editing posts & pages, viewing posts and comments in the Reader.

@crazytonyli crazytonyli added this to the 26.6 milestone Dec 10, 2025
@crazytonyli crazytonyli requested a review from kean December 10, 2025 00:39
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 10, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30131
VersionPR #25056
Bundle IDorg.wordpress.alpha
Commit2cfc79a
Installation URL2avgu0lg69us0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 10, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30131
VersionPR #25056
Bundle IDcom.jetpack.alpha
Commit2cfc79a
Installation URL5egj01rl6oam0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@crazytonyli crazytonyli force-pushed the core-data-mismatch-declarations branch from 13f529a to 3e0e4d9 Compare December 10, 2025 00:59
@crazytonyli crazytonyli changed the title Translate ReaderPost to Swift Translate post types to Swift Dec 10, 2025
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger


// A ReaderCard can have either a post, or a list of topics, but not both.
// Since this card has a post, we can confidently set `topics` to NULL.
if responds(to: #selector(getter: card)), let managedObjectContext, let firstCard = card?.first {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd double-check if this works, and check if it's needed in the first place and if there are ways to refactor it. I can't say I have a lot of confidence in these types of Swift and Objective-C interactions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. I have double-checked. The responds(to:) in the new Swift code returns true, and the if branch is executed. I'm pretty certain the card is always available in practice. The original Objective-C code was introduced in #17117. Since the commit message mentioned migration, I thought I'd be extra careful here and keep the original code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I'm sure there is more similar stuff to remove. A lot of these methods were added to satisfy interfaces that were only ever used on regular (not Reader) posts.

return content.isEmpty || content == emptyGBParagraph
}

public func contentPreviewForDisplay() -> String? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) It would be ideal to remove it. I don't think we need it for ReaderPost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Removed in 2cfc79a

@sonarqubecloud
Copy link

@crazytonyli crazytonyli requested a review from kean December 11, 2025 23:58
@crazytonyli crazytonyli added this pull request to the merge queue Dec 16, 2025
Merged via the queue into trunk with commit be2f4c8 Dec 16, 2025
26 of 32 checks passed
@crazytonyli crazytonyli deleted the core-data-mismatch-declarations branch December 16, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants