Skip to content

RS Post Settings: Fetch site post formats from themes API#22710

Draft
nbradbury wants to merge 3 commits intotrunkfrom
feature/rs-posts-post-formats
Draft

RS Post Settings: Fetch site post formats from themes API#22710
nbradbury wants to merge 3 commits intotrunkfrom
feature/rs-posts-post-formats

Conversation

@nbradbury
Copy link
Contributor

@nbradbury nbradbury commented Mar 19, 2026

Description

The RS post settings FormatDialog previously hardcoded all 10 standard post formats. This PR fetches the formats actually supported by the site's active theme using the wordpress-rs themes API (themes().listWithViewContext()), falling back to the full default list if the API call fails.

Testing instructions

Theme with limited format support:

  1. View settings for a post on the "Rabbit Of Caribbeans" test site (whose active theme supports only a subset of formats)
  2. Tap the Format row to open the format dialog
  • Verify the dialog shows only the theme-supported formats plus Standard
format

Fallback on failure:

  1. Open a post, then disable network
  2. Tap the Format row
  • Verify the dialog shows the full default list of 10 formats
format2

nbradbury and others added 3 commits March 19, 2026 08:47
Fetch the active theme's supported post formats via the wordpress-rs
themes API instead of hardcoding all 10 formats. Falls back to the
full default list on failure or when the theme doesn't declare support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant outer try/catch (caller already handles exceptions)
and replace mutable list + none/add pattern with distinct() for
prepending Standard format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defer the themes API call until the user actually opens the format
picker, avoiding an unnecessary network request on every screen load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@sonarqubecloud
Copy link

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22710-591b0da
Build Number1487
Application IDorg.wordpress.android.prealpha
Commit591b0da
Installation URL2gi1u7717809o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22710-591b0da
Build Number1487
Application IDcom.jetpack.android.prealpha
Commit591b0da
Installation URL69cnjmedjrui0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

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.

3 participants