Repository navigation
task: load wp-env post types and posts in the Android demo - #824
Merged
Merged
Conversation
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/824")Built from 2a8c560 |
The local WordPress site was never stored as an account, so the Android demo couldn't build an API client for it. The post type picker fell back to Post alone, and Browse was hidden. Like the iOS demo, it now builds an in-memory account from the wp-env credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YNDBX7RNXn3NsfDuV1PkNV
Match the iOS demo, which computes the auth header from the credentials and reads the editor config from the in-memory account. Also stop a missing account ID from resolving to the local site's ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ae1XmRJfxLNoawZJQ2nYQ5
…demo The REST route uses the post type's rest_base, which can differ from its slug, so Browse and Save failed with rest_no_route for those types. Matches the iOS demo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ae1XmRJfxLNoawZJQ2nYQ5
`all()` decrypts every stored account to return one, and fails outright if any of them can't be decrypted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ae1XmRJfxLNoawZJQ2nYQ5
dcalhoun
force-pushed
the
task/browse-wp-env-posts-in-android-demo
branch
from
October 23, 2026 15:33
00281fe to
2a8c560
Compare
dcalhoun
marked this pull request as ready for review
October 23, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Load the post types and posts in the Android demo.
Why?
This functionality was available for remote sites, but not the local wp-env site. iOS already supports this ability.
How?
Build the local wp-env credentials into to an in-memory
Account.SelfHostedSitethat can be utilized by theSitePreparationActivity.Testing Instructions
make wp-env-startAccessibility Testing Instructions
N/A, unnecessary for the demo app.
Screenshots or screencast
N/A, no visual changes.
AI-generated details
The Android demo never stored the local WordPress (wp-env) site as an account, so every account lookup for it failed. The post type picker fell back to Post alone, and Browse was hidden. That blocks testing custom post types on wp-env, such as #794's templated post type.
Like the iOS demo (
SitePreparationView.swift), it now builds an in-memoryAccount.SelfHostedSitefrom the wp-env credentials:LocalWordPressCredentials.toAccount()and a reservedACCOUNT_IDof0. Stored accounts never use it, as wordpress-rs numbers them from 1.GutenbergKitApplication.findAccount(id), which the post type picker, posts list, and Save button now use.Side effect: posts opened from wp-env through Browse can now be saved from the demo app, as for other sites.
Testing
:app:compileDebugKotlinandmake lint-androidpass.make wp-env-start, then build and run the Android demo app from the same checkout, as it reads.wp-env.credentials.jsonat build time.🤖 Generated with Claude Code
https://claude.ai/code/session_01YNDBX7RNXn3NsfDuV1PkNV