-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add PostFormatPicker #24620
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
Add PostFormatPicker #24620
Conversation
| Post *post = self.post; | ||
| NSArray *titles = post.blog.sortedPostFormatNames; | ||
|
|
||
| if (![self.internetReachability isReachable] && self.formatsList.count == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only significant logic change is here – it will no longer stop you from opening the app if the app thinks it's offline and there are not synced formats. In this case, it will open and show an EmptyStateView with an error and a way to refresh.
| import WordPressUI | ||
|
|
||
| @MainActor | ||
| struct PostFormatPicker: View { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there will be more similar use cases, I'll look into generalizing this.
| // Readonly Properties | ||
| @property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormatNames; | ||
| @property (nonatomic, weak, readonly, nullable) NSArray *sortedPostFormats; | ||
| @property (nonatomic, weak, readonly, nullable) NSArray *sortedConnections; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude rewrote these too, so I went with it.
82f3b98 to
67773de
Compare
67773de to
9bdf328
Compare
|
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 27975 | |
| Version | PR #24620 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 9bdf328 | |
| Installation URL | 0rg4eqv06ojjg |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 27975 | |
| Version | PR #24620 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 9bdf328 | |
| Installation URL | 1nrvthrsmqtho |
| self.blog = post.blog | ||
| let formats = post.blog.sortedPostFormatNames | ||
| self._formats = State(initialValue: formats) | ||
| self._selction = State(initialValue: post.postFormatText() ?? "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest moving this to onAppear like you did in #24597 (comment). However, I just realised that changes to these properties may get reverted when the onAppear method is called again (see #24597 (comment)).





Closes https://linear.app/a8c/issue/CMM-530/settingsselectionviewcontroller-objc
A mechanical rewrite from Objective-C to Swift. No functional changes.
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-06-24.at.15.35.45.mov