Skip to content

fix(admin): standardise button and link patterns across admin UI - #934

Merged
ascorbic merged 1 commit into
mainfrom
fix/admin-button-consistency
May 7, 2026
Merged

ascorbic merged 1 commit into
mainfrom
fix/admin-button-consistency

Conversation

@ascorbic

@ascorbic ascorbic commented May 7, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Cleans up button and link inconsistencies across the admin UI. Started from a single `size="sm"` mismatch on the content editor toolbar's Discard changes button and expanded into a focused audit of related patterns.

Changes by file:

  • `ContentEditor.tsx` — Drop `size="sm"` on the Discard changes trigger (it sat next to default-sized buttons). Convert the Live View link from a raw `<a target="_blank">` styled with `buttonVariants` to ``.
  • `ContentList.tsx` — Convert the published-content view link (icon-only) from raw anchor to `<LinkButton external shape="square">`.
  • `PluginManager.tsx` — Fix invalid `` nesting (renders ``) by switching the Marketplace link to ``, matching the convention already used in `ContentList` / `ContentTypeList`. Also convert three buttons from manual `<Icon className="me-2 h-4 w-4" />` children to the `icon` prop.
  • `ThemeMarketplaceDetail.tsx` — Convert the Demo button from `<Button onClick={() => window.open(...)}>` to a real `` (gives middle-click + open-in-new-tab behaviour). Convert Try with my data to use the `icon` prop.
  • `MarketplacePluginDetail.tsx`, `MarketplaceBrowse.tsx`, `ThemeMarketplaceBrowse.tsx` — Convert remaining `<Icon className="me-2 h-4 w-4" />` patterns to the `icon` prop.
  • `WordPressImport.tsx` — Replace hard-coded `text-blue-600` with the `text-kumo-brand` semantic token (was bypassing dark mode); add missing `aria-hidden` on a decorative icon.
  • `MenuList.tsx` — Class order nit on a decorative icon (`h-4 w-4 me-2` -> `me-2 h-4 w-4`); add missing `aria-hidden`.
  • `users/UserList.tsx` — Two bare ``s in the empty state had English string literals ("Clear filters", "Invite your first team member") that bypassed Lingui. Wrapped in `t``` and added `type="button"` (was missing — would default to `submit` if ever placed inside a form).

I deliberately scoped the i18n fix to just the two flagged buttons. `UserList.tsx` has many more untranslated strings (table headers, search placeholder, etc.); those should be a separate translation PR per the AGENTS.md "don't make bulk/spray changes" rule.

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

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7 (OpenCode)

Screenshots / test output

The visible behaviour change in this PR is uniformity — all toolbar buttons now share the default `size="base"` and Kumo's icon spacing. Live View and the Demo link now render as Kumo `LinkButton`s with proper `external` semantics (`target="_blank" rel="noopener noreferrer"`) and middle-click support. The Marketplace link in the plugin manager no longer renders invalid `` nested HTML.

Use Kumo's Button icon prop and LinkButton (with external for new-tab links)
instead of manual icon spacing and raw anchor styling. Fix invalid Link/Button
nesting in plugin manager. Translate stray English strings in user list empty
state.
Copilot AI review requested due to automatic review settings May 7, 2026 11:50
@cloudflare-workers-and-pages

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-perf-coordinator 523722e May 07 2026, 11:50 AM

@changeset-bot

changeset-bot Bot commented May 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 523722e

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

This PR includes changesets to release 13 packages
Name Type
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/cloudflare Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-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

@cloudflare-workers-and-pages

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-i18n 523722e May 07 2026, 11:51 AM

@cloudflare-workers-and-pages

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 523722e May 07 2026, 11:51 AM

@cloudflare-workers-and-pages

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 523722e May 07 2026, 11:52 AM

@cloudflare-workers-and-pages

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 523722e May 07 2026, 11:52 AM

@pkg-pr-new

pkg-pr-new Bot commented May 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

emdash

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

create-emdash

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

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

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 523722e

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

Standardizes button/link usage across the admin UI by replacing ad-hoc anchor styling and manual icon spacing with Kumo’s LinkButton and Button icon prop, improving consistency and fixing one instance of invalid nested interactive HTML.

Changes:

  • Replaces raw external <a> links styled as buttons with LinkButton external where appropriate (including icon-only “view” links).
  • Converts multiple buttons from manual <Icon className="me-2 ..."> patterns to the icon prop for consistent spacing.
  • Fixes invalid <Link><Button></Button></Link> nesting in the plugin manager by styling the Link via buttonVariants, and wraps two stray user-facing strings in Lingui t.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/admin/src/components/WordPressImport.tsx Uses semantic brand token for link color and marks a decorative icon aria-hidden.
packages/admin/src/components/users/UserList.tsx Wraps two empty-state button labels in Lingui t and sets type="button".
packages/admin/src/components/ThemeMarketplaceDetail.tsx Uses LinkButton external for the Demo link and switches a button icon to the icon prop.
packages/admin/src/components/ThemeMarketplaceBrowse.tsx Converts retry button icon to the icon prop.
packages/admin/src/components/PluginManager.tsx Removes invalid link/button nesting; uses buttonVariants on Link and converts icons to icon prop in relevant buttons.
packages/admin/src/components/MenuList.tsx Reorders icon classes and adds aria-hidden to a decorative icon.
packages/admin/src/components/MarketplacePluginDetail.tsx Converts install button icon to the icon prop.
packages/admin/src/components/MarketplaceBrowse.tsx Converts retry button icon to the icon prop.
packages/admin/src/components/ContentList.tsx Replaces published “view” anchor with LinkButton external (icon-only) for consistent semantics/styling.
packages/admin/src/components/ContentEditor.tsx Removes the small-size mismatch on Discard changes and converts Live View to LinkButton external.
.changeset/legal-doodles-move.md Adds a patch changeset describing the admin UI standardization changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants