Skip to content

fix(admin): normalize content lifecycle status badges - #2340

Merged
khoinguyenpham04 merged 7 commits into
mainfrom
ui/normalize-publish-labels
Aug 5, 2026
Merged

khoinguyenpham04 merged 7 commits into
mainfrom
ui/normalize-publish-labels

Conversation

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator

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.

  • Uses Publish instead of mixed Published labels for the normalized published state.
  • Adds a shared localized status component for Publish, Draft, Scheduled, Archived, Pending changes, and Private.
  • Preserves the dashed-circle Draft icon with Kumo's native warning treatment.
  • Normalizes recognized statuses for collections without draft support while retaining custom-status fallbacks.
  • Covers list rows and filters, the content picker, editor settings, and Dashboard status indicators.

Related issue: N/A

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: N/A — bug fix

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: OpenAI Codex (GPT-5.6 Sol), with GPT-5.6 Terra xhigh adversarial review

Screenshots / test output

Verified:

  • pnpm typecheck
  • pnpm lint
  • 90 focused Chromium tests across ContentStatusBadge, ContentList, ContentSettingsPanel, and Dashboard
  • English and Arabic RTL behavior on the local admin UI

No locale catalog files are included; the normal extraction workflow can update them after merge.

Copilot AI lite review requested due to automatic review settings August 5, 2026 10:00
@changeset-bot

changeset-bot Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4472e9a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/plugin-mcp-smoke Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds Patch

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

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet area/admin size/XL labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Scope check

This 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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 4472e9a Aug 05 2026, 10:46 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 4472e9a Aug 05 2026, 10:46 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 4472e9a Aug 05 2026, 10:46 AM

@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2340

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2340

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2340

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2340

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2340

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2340

emdash

npm i https://pkg.pr.new/emdash@2340

create-emdash

npm i https://pkg.pr.new/create-emdash@2340

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2340

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2340

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2340

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2340

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2340

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2340

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2340

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2340

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2340

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2340

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2340

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2340

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2340

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2340

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2340

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2340

commit: 4472e9a

@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / ContentStatusIcon to 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.

@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Aug 5, 2026
@github-actions github-actions Bot added review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Aug 5, 2026
@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.po files 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 in ContentList.test.tsx confirms 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.

@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 5, 2026
@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview New commits since the last review labels Aug 5, 2026
@khoinguyenpham04
khoinguyenpham04 merged commit d2c259c into main Aug 5, 2026
66 checks passed
@khoinguyenpham04
khoinguyenpham04 deleted the ui/normalize-publish-labels branch August 5, 2026 11:01
@emdashbot emdashbot Bot mentioned this pull request Aug 5, 2026
@MA2153 MA2153 mentioned this pull request Aug 5, 2026
11 of 18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/admin review/approved Approved; no new commits since size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants