Repository navigation
task: show post type labels in the demo apps - #822
Merged
Merged
Conversation
Slugs and REST bases read poorly once capitalized, e.g. "Templated-Posts". The labels match what WP Admin shows. The slug remains the fallback when the post types weren't loaded from the site. Also fixes the "No Entires" typo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YNDBX7RNXn3NsfDuV1PkNV
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/822")Built from 1b8c139 |
Detekt identifies baselined issues by the function signature, so adding the labels parameter resurfaced the card's existing LongMethod and LongParameterList issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YNDBX7RNXn3NsfDuV1PkNV
The assignment ran before the editor configuration existed, so the setter returned early and the default was always `post`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Storing labels in a slug-keyed map beside the post types let the two drift and spread the fallback across call sites. Keeping each label on its post type resolves the fallback once and drops the dictionary that trapped on duplicate slugs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A post type registered with an empty label otherwise renders a blank picker row and posts-list title. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The picker shows labels, so sorting by slug read as random (e.g. "Templated Post, Page, Post"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches the iOS posts list, which already shows e.g. "Pages" instead of a hard-coded "Posts". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
LGTM! Just noting this point for you to decide whether it's worth fixing.
|
adalpari
approved these changes
Oct 23, 2026
Labels aren't unique (an unlabeled custom type inherits "Post" or "Page"), and the REST response map's order is randomly seeded, so tied rows reordered between launches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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?
Fix demo app typos and display post type labels rather than slugs.
Why?
Improve demo app quality.
How?
Display the post type's
labelsattribute rather than its key.Testing Instructions
Manually testing this demo app change is not that important, but:
The screenshots below are from #794, which adds a multiword post type that benefits from the changes.
Accessibility Testing Instructions
N/A, small demo app change.
Screenshots or screencast
AI-generated details
The demo apps showed post types by their capitalized slug or REST base, which reads poorly for custom types: #794's test type showed as "Gbk_Templated" in the iOS picker and "Templated-Posts" as the iOS posts list title.
PostTypeDetailsin the library is unchanged, as the labels stay in each app's view model.Testing
templated_post), and verify the picker and the iOS posts list title show its labels.🤖 Generated with Claude Code
https://claude.ai/code/session_01YNDBX7RNXn3NsfDuV1PkNV