Repository navigation
fix(admin): normalize content lifecycle status badges - #2340
Conversation
🦋 Changeset detectedLatest commit: 4472e9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Scope checkThis PR changes 577 lines across 12 files. Large PRs are harder to review and more likely to be closed without review. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 4472e9a | Aug 05 2026, 10:46 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 4472e9a | Aug 05 2026, 10:46 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 4472e9a | Aug 05 2026, 10:46 AM |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
Pull request overview
This PR standardizes how content lifecycle state is represented across the admin UI by introducing a shared, localized status badge/label/icon component and updating Dashboard, lists, pickers, and settings panels to use it.
Changes:
- Adds
ContentStatusBadge/ContentStatusLabel/ContentStatusIconto unify lifecycle labels, icons, and semantic Kumo colors (including “Pending changes” and “Private”). - Updates Dashboard, Content List (rows + filter + bulk publish), Content Picker, and Content Settings panel to render normalized states (notably using “Publish” for the published state).
- Updates/expands tests to cover normalized labels, accessibility labels, RTL behavior, and prototype-safe handling of unknown status strings.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/admin/src/components/ContentStatusBadge.tsx | Introduces shared localized lifecycle badge/label/icon primitives with consistent icons and semantic colors. |
| packages/admin/src/components/Dashboard.tsx | Replaces ad-hoc status dot/icon logic and count badge icons with normalized status components/mapping. |
| packages/admin/src/components/ContentList.tsx | Normalizes row badges, adds iconified status filter rendering, and adds a publish icon to bulk publish action. |
| packages/admin/src/components/ContentPickerModal.tsx | Replaces custom status dot/text with the shared ContentStatusLabel derived from draft status. |
| packages/admin/src/components/ContentSettingsPanel.tsx | Replaces per-panel status badge logic with ContentStatusBadge and normalizes publish button labels. |
| packages/admin/tests/components/ContentStatusBadge.test.tsx | Adds focused unit coverage for badge/label/icon rendering and accessibility behavior. |
| packages/admin/tests/components/Dashboard.test.tsx | Adds tests asserting normalized accessible labels and safe handling of “toString” status. |
| packages/admin/tests/components/ContentList.test.tsx | Updates badge expectations, adds RTL ordering assertion, adds filter icon checks, and prototype-safety coverage. |
| packages/admin/tests/components/ContentSettingsPanel.test.tsx | Adds/updates tests for pending changes, scheduled display, no-draft normalization, and publish label normalization. |
| packages/admin/tests/components/ContentEditor.test.tsx | Updates expectations for the normalized “Publish” button label. |
| packages/admin/tests/publish-button-locale.test.tsx | Updates assertions and comments to reflect normalized “Publish” label in the publish-button locale regression test. |
| .changeset/normalize-publish-labels.md | Adds a patch changeset documenting the user-visible normalization of lifecycle badges/labels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
This PR is a focused, sensible bug fix: it centralizes content-status presentation in a single component and wires it consistently across the admin UI. The approach fits EmDash — a shared React component, Lingui-wrapped strings, Kumo semantic tokens, and RTL-safe logical flex layout. I read the new ContentStatusBadge component, its usage in ContentList, ContentPickerModal, ContentSettingsPanel, and Dashboard, plus the test updates and changeset.
No logic errors, security issues, or logged-out query changes were introduced; the changeset and i18n conventions are met. I did notice a couple of new test assertions that pin exact Tailwind class names. Per AGENTS.md, tests that assert the CSS classes you just added are tautological — they fail only when someone intentionally changes styling, and they inflate coverage without proving observable behavior. These are non-blocking suggestions.
There was a problem hiding this comment.
This is a focused, sensible bug fix that centralizes content-status presentation in a single component and wires it consistently across the admin UI. The approach fits EmDash well — a shared React component, Lingui-wrapped strings, Kumo semantic tokens, and RTL-safe logical flex layout.
I re-read the new ContentStatusBadge component, its usage in ContentList, ContentPickerModal, ContentSettingsPanel, and Dashboard, plus the test updates and changeset. The PR covers list rows/filters, the content picker, editor settings, and Dashboard indicators as advertised, and it correctly preserves custom-status fallbacks for collections without draft support. I also verified there are no leftover references to the old "Publish Post" / "Publish updates" labels in the admin package.
Conventions look good:
- All user-facing strings go through Lingui; no
messages.pofiles are included (the PR relies on the post-merge extraction workflow, which is correct). - Tailwind uses semantic Kumo tokens (
text-kumo-success,bg-kumo-fill, etc.) and logical layout (inline-flex,gap); the RTL test inContentList.test.tsxconfirms icon ordering flips in Arabic. - The changeset is present, concise, and written for users rather than as a diff summary.
- No new queries, route changes, or authorization concerns were introduced (this is UI-only).
The only semantic choice worth noting is the PR's intentional use of "Publish" as both action and status label. In status/filter contexts it reads more like an action than a state (compared with "Published"), but the PR description is explicit about this normalization and it is applied consistently.
Compared with my previous review: I no longer see new test assertions that pin exact Tailwind class names in the changed code. The pre-existing "button-emphasis-bg" class check in ContentSettingsPanel.test.tsx predates this PR and remains non-blocking. No logic errors or security issues were found; I'd sign off as-is.
What does this PR do?
Normalizes content lifecycle presentation across the admin UI so status badges, compact labels, filters, actions, and Dashboard indicators use consistent wording, icons, and semantic Kumo colors.
Publishinstead of mixedPublishedlabels for the normalized published state.Related issue: N/A
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.AI-generated code disclosure
Screenshots / test output
Verified:
pnpm typecheckpnpm lintNo locale catalog files are included; the normal extraction workflow can update them after merge.