Skip to content

refactor(admin): use Kumo semantic tokens for status colors - #1866

Merged
khoinguyenpham04 merged 10 commits into
mainfrom
claude/determined-shannon-798e32
Jul 9, 2026
Merged

khoinguyenpham04 merged 10 commits into
mainfrom
claude/determined-shannon-798e32

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Migrates admin UI status colors from hard-coded Tailwind palette classes and dark: prefixes to Kumo semantic tokens across 17 admin components.

This also fixes warning highlights that used nonexistent bg-warning / text-warning classes in:

  • MarketplaceBrowse audit warn badge
  • CapabilityConsentDialog warning states

RoleBadge and CommentStatusBadge now use Kumo Badge variants instead of hand-rolled colored spans.

Editor-journey files are intentionally untouched in this PR.

Closes #

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) — n/a, styling-only refactor and token fix.
  • 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. n/a, no new strings.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: n/a, no new feature

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Fable 5 (Claude Code)

Screenshots / test output

  • pnpm lint:json | jq '.diagnostics | length': 0
  • pnpm lint:quick: passed
  • pnpm typecheck: passed
  • pnpm --filter @emdash-cms/admin test: 84 files / 1050 tests passed
  • pnpm format:check: passed
  • Visual check: light and dark themes for role badges, comment status badges, content type icons, user status, and email settings callouts

Try this PR

Open a fresh playground →

A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.

Tracks claude/determined-shannon-798e32. Updated automatically when the playground redeploys.

Copilot AI review requested due to automatic review settings July 7, 2026 22:36
@changeset-bot

changeset-bot Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b0fd41

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

This PR includes changesets to release 16 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd 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 the review/awaiting-author Reviewed; waiting on the author to respond label Jul 7, 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pkg-pr-new

pkg-pr-new Bot commented Jul 7, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 3b0fd41

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 3b0fd41 Jul 09 2026, 09:41 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 3b0fd41 Jul 09 2026, 09:41 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 7, 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 3b0fd41 Jul 09 2026, 09:41 AM

@github-actions github-actions Bot added area/templates review/needs-rereview New commits since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 7, 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 the right kind of refactor: it is narrowly scoped to swapping hard-coded Tailwind palette classes for Kumo semantic tokens, aligns with AGENTS.md’s styling rules, and leaves all non-UI logic untouched. The changeset is appropriate, and the editor-journey files the PR explicitly skips still have legacy dark: classes.

I read the full diff, re-read the changed files, and searched the tree for remaining dark: prefixes in the touched files and for existing Badge variant usage. All changed files are now dark:-free. The conversion looks consistent across callouts, status dots, badges, and icon squares.

I only have two small, non-blocking notes: RoleBadge now sizes the small variant by text alone, which could leave padding inconsistent between sizes; and the refactor introduces several Badge variant values (warning, error, neutral, plus role colors) that are not used anywhere else in the admin, so worth a quick visual/type check. No blocking issues.


Findings

  • [suggestion] packages/admin/src/components/users/RoleBadge.tsx:43-46

    The sm size now overrides only text-xs, while md still adds explicit px-2.5 py-1 text-sm. If Kumo Badge supplies its own default padding this makes the two sizes diverge; if it does not, the small badge collapses to text-only. Since the PR says there are no behavior changes, make sizing explicit for both variants.

    	const sizeClasses = {
    		sm: "px-2 py-0.5 text-xs",
    		md: "px-2.5 py-1 text-sm",
    	};
    
  • [suggestion] packages/admin/src/components/users/RoleBadge.tsx:23-29

    This refactor introduces Badge variants that are not used anywhere else in the admin (blue, green, purple, red, neutral). The existing codebase only uses success, secondary, outline, and destructive. I cannot verify the Kumo Badge API without installed types, so this is just a heads-up: please confirm these variants are supported and render the intended colors. (Same note applies to CommentStatusBadge in packages/admin/src/components/comments/CommentDetail.tsx for warning, error, and neutral.)

  • [suggestion] packages/admin/src/components/MarketplaceBrowse.tsx:329

    The pass branch now uses the prefixed kumo-success tokens, but the warn branch still uses the bare warning token. For consistency with the rest of this refactor, consider migrating it to the prefixed Kumo token as well.

    				className="inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs bg-kumo-warning/10 text-kumo-warning"
    

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview New commits since the last review labels Jul 7, 2026
Replace hard-coded Tailwind palette classes and dark: prefixes with Kumo
semantic tokens across 17 admin components so status colors theme
consistently in light and dark mode.

Convert the hand-rolled RoleBadge and CommentStatusBadge spans into Kumo
Badge wrappers with semantic variants.
@khoinguyenpham04
khoinguyenpham04 force-pushed the claude/determined-shannon-798e32 branch from 28ac83a to 07e0778 Compare July 7, 2026 22:45
@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 Jul 7, 2026
khoinguyenpham04 and others added 6 commits July 7, 2026 23:48
The warn branch of AuditBadge used bare warning utilities that have no
token definition, so the badge rendered unstyled. Use the kumo-warning
tokens like the pass and fail branches.
All six warning highlights in the dialog referenced a bare warning
color token that has no definition in the admin theme, so new-capability
rows, the public-routes notice, and the warn audit banner rendered
unstyled. Use the kumo-warning tokens.
An automated style commit on this branch collapsed formatting that the
pinned oxfmt/prettier versions expect expanded, which broke the CI
format check. Re-running pnpm format restores the expected output.
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
10 of 18 tasks
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@khoinguyenpham04

Copy link
Copy Markdown
Collaborator Author

This is the right kind of refactor: it is narrowly scoped to swapping hard-coded Tailwind palette classes for Kumo semantic tokens, aligns with AGENTS.md’s styling rules, and leaves all non-UI logic untouched. The changeset is appropriate, and the editor-journey files the PR explicitly skips still have legacy dark: classes.

I read the full diff, re-read the changed files, and searched the tree for remaining dark: prefixes in the touched files and for existing Badge variant usage. All changed files are now dark:-free. The conversion looks consistent across callouts, status dots, badges, and icon squares.

I only have two small, non-blocking notes: RoleBadge now sizes the small variant by text alone, which could leave padding inconsistent between sizes; and the refactor introduces several Badge variant values (warning, error, neutral, plus role colors) that are not used anywhere else in the admin, so worth a quick visual/type check. No blocking issues.

Findings

  • [suggestion] packages/admin/src/components/users/RoleBadge.tsx:43-46
    The sm size now overrides only text-xs, while md still adds explicit px-2.5 py-1 text-sm. If Kumo Badge supplies its own default padding this makes the two sizes diverge; if it does not, the small badge collapses to text-only. Since the PR says there are no behavior changes, make sizing explicit for both variants.
    	const sizeClasses = {
    		sm: "px-2 py-0.5 text-xs",
    		md: "px-2.5 py-1 text-sm",
    	};
    
  • [suggestion] packages/admin/src/components/users/RoleBadge.tsx:23-29
    This refactor introduces Badge variants that are not used anywhere else in the admin (blue, green, purple, red, neutral). The existing codebase only uses success, secondary, outline, and destructive. I cannot verify the Kumo Badge API without installed types, so this is just a heads-up: please confirm these variants are supported and render the intended colors. (Same note applies to CommentStatusBadge in packages/admin/src/components/comments/CommentDetail.tsx for warning, error, and neutral.)
  • [suggestion] packages/admin/src/components/MarketplaceBrowse.tsx:329
    The pass branch now uses the prefixed kumo-success tokens, but the warn branch still uses the bare warning token. For consistency with the rest of this refactor, consider migrating it to the prefixed Kumo token as well.
    				className="inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs bg-kumo-warning/10 text-kumo-warning"
    

Follow-up commits addressed these issue.

@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Jul 8, 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 the right kind of refactor: narrowly scoped to swapping hard-coded Tailwind palette classes and dark: prefixes for Kumo semantic tokens, with no logic changes. The changeset is appropriate, no new user-facing strings were added, and messages.po changes were correctly omitted.

The bare warning token I flagged in the previous review is now resolved — MarketplaceBrowse uses bg-kumo-warning/10 text-kumo-warning consistently. I checked all changed files for remaining raw palette classes and dark: prefixes and found none.

I have two remaining notes:

  1. ContentTypeList introduces bg-kumo-badge-purple / bg-kumo-badge-blue, which are not used anywhere else in the admin and are not present in packages/admin/src/styles.css. If Kumo 2.6.0 does not ship these tokens, the content-type icon squares will render without a background. Worth confirming or switching to documented Kumo tokens.
  2. RoleBadge still sizes the sm variant by text alone while md adds explicit padding; this is a carry-over from the previous review. If Kumo Badge does not supply equivalent default padding, the two sizes will diverge.

Neither is a hard blocker for a styling-only refactor, but the badge-bg tokens in particular should be verified before merge.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview New commits since the last review labels Jul 8, 2026
@khoinguyenpham04
khoinguyenpham04 requested a review from ascorbic July 8, 2026 12:54
@khoinguyenpham04 khoinguyenpham04 added bot:review Trigger an emdashbot code review on this PR and removed bot:review Trigger an emdashbot code review on this PR labels Jul 8, 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 narrowly-scoped styling refactor: it strips hard-coded Tailwind palette classes and dark: prefixes from admin components and replaces them with Kumo semantic tokens, plus fixes the genuinely nonexistent bg-warning / text-warning classes. The changeset is appropriate, no new user-facing strings were introduced, and messages.po updates were correctly omitted.

As a re-review, my main concern remains the same as the previous pass: the PR introduces two token names that are not documented anywhere in this repo — bg-kumo-badge-purple / bg-kumo-badge-blue in ContentTypeList, and bg-kumo-subtle in ContentPickerModal. If Kumo 2.6.0 does not ship those exact CSS variables, Tailwind will silently drop the classes and those elements will render without their intended backgrounds. For the white icon squares in ContentTypeList, that means a real light-mode visual regression (white icons on the white/light table row). The author noted visual checks passed, but these tokens should still be confirmed against the Kumo 2.6.0 build or switched to documented tokens before merge.

Static checks found no remaining raw palette classes or dark: prefixes in the admin .tsx files, and the warning-token fixes in MarketplaceBrowse and CapabilityConsentDialog are correct. The RoleBadge migration to Kumo Badge is reasonable, though the sm/md sizing is still inconsistent.

I did not run the test suite, linter, or build (no shell access), so I cannot independently verify the author's reported pass results.

Co-authored-by: emdashbot[bot] <273199577+emdashbot[bot]@users.noreply.github.com>
@github-actions github-actions Bot added review/needs-rereview New commits since the last review needs-rebase and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 8, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 9, 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
docs 3b0fd41 Jul 09 2026, 09:41 AM

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, thanks!

@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 Jul 9, 2026
@khoinguyenpham04
khoinguyenpham04 merged commit d2f5ddc into main Jul 9, 2026
49 checks passed
@khoinguyenpham04
khoinguyenpham04 deleted the claude/determined-shannon-798e32 branch July 9, 2026 10:51
@emdashbot emdashbot Bot mentioned this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/admin area/templates bot:review Trigger an emdashbot code review on this PR cla: signed review/approved Approved; no new commits since size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants