Skip to content

Update admin navigation icon vocabulary#2151

Merged
ascorbic merged 4 commits into
mainfrom
admin-navigation-icons
Jul 20, 2026
Merged

Update admin navigation icon vocabulary#2151
ascorbic merged 4 commits into
mainfrom
admin-navigation-icons

Conversation

@khoinguyenpham04

@khoinguyenpham04 khoinguyenpham04 commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes duplicated and ambiguous admin navigation icons by centralizing the first-party Phosphor icon vocabulary and reusing it across the sidebar, command palette, content search results, and related empty states.

Pages and posts receive distinct Browser and Newspaper overrides, while custom collections retain Files. The update also distinguishes comments, menus, redirects, widgets, sections, taxonomies, bylines, Byline Schema, plugins, and imports. Plugin-declared page icons now resolve consistently in both navigation surfaces with a safe Plug fallback.

Related issue/discussion: N/A — maintainer-directed visual consistency correction.

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). No user-visible strings or catalog files changed.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: N/A — this corrects existing icon presentation and adds no feature behavior.

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: GPT-5 Codex

Screenshots / test output

  • pnpm typecheck
  • pnpm lint:json — zero diagnostics
  • 45 focused admin tests across navigation, menus, comments, sections, and bylines
  • pnpm --filter @emdash-cms/admin build
  • Scoped oxfmt check for every branch-changed file
  • Browser-verified in the simple demo at /_emdash/admin

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 admin-navigation-icons. Updated automatically when the playground redeploys.

Copilot AI review requested due to automatic review settings July 20, 2026 17:17
@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a354530

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

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.

@github-actions github-actions Bot added the review/awaiting-author Reviewed; waiting on the author to respond label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 610 lines across 16 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 Jul 20, 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 a354530 Jul 20 2026, 05:34 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 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 a354530 Jul 20 2026, 05:34 PM

@pkg-pr-new

pkg-pr-new Bot commented Jul 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-verification

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: a354530

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 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 a354530 Jul 20 2026, 05:36 PM

@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 94ef6d8 Jul 20 2026, 05:21 PM

@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, maintainer-directed visual-consistency fix: it extracts a first-party admin icon vocabulary into admin-navigation-icons.ts and shares it across the sidebar, command palette, content-search results, and related empty states. The approach is sound for the stated problem: it removes the duplicated FileText/ PuzzlePiece defaults, gives pages/posts/taxonomies/bylines/etc. distinct glyphs, and keeps plugin-page icons resolving consistently with a Plug fallback. It also preserves the existing lazy-icon behavior for uncommon Phosphor names.

What I checked:

  • Read the full diff and the new admin-navigation-icons.ts.
  • Read the touched components (Sidebar, AdminCommandPalette, Dashboard, Redirects, MenuList, PluginManager, SectionPickerModal, CommentInbox, etc.) to confirm the new icon helpers are wired correctly.
  • Traced call sites for resolveNavIcon, toPhosphorIconName, PuzzlePiece, and ADMIN_NAV_ICONS to verify no stale imports or mismatched fallbacks remain.
  • Reviewed the new and updated tests; they cover collection overrides, taxonomy tags vs. categories, plugin-page icon resolution, and the Plug fallback.
  • Checked the changeset against the AGENTS.md guidance (present-tense, user-facing description, patch bump for @emdash-cms/admin).

I did not find any logic bugs, regressions, AGENTS.md convention violations, or security/data issues. The lazy-icon cache stays module-scoped, which matches the pre-existing pattern and is acceptable for the browser SPA; moving it to globalThis would be a nice future refactor but is not required here. No user-facing strings changed, so no Lingui updates are needed.

Headline: LGTM — the centralized vocabulary is the right structural fix and the implementation looks clean.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/awaiting-author Reviewed; waiting on the author to respond labels Jul 20, 2026
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/approved Approved; no new commits since labels Jul 20, 2026
@khoinguyenpham04 khoinguyenpham04 self-assigned this Jul 20, 2026
@khoinguyenpham04 khoinguyenpham04 added the bot:review Trigger an emdashbot code review on this PR label Jul 20, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Jul 20, 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 re-review confirms the PR is still a focused, maintainer-directed visual-consistency fix. Centralizing the first-party admin icon vocabulary in admin-navigation-icons.ts is the right structural response to the duplicated/ambiguous icon problem: it guarantees the same glyph is used in the sidebar, command palette, content-search results, and the related empty states, with a consistent Plug fallback for plugin pages.

What I checked:

  • Re-read the full diff and the new admin-navigation-icons.ts module.
  • Verified each touched component (Sidebar, AdminCommandPalette, Dashboard, CommentInbox, Redirects, MenuList, SectionPickerModal, PluginManager, MarketplaceBrowse, RegistryBrowse, bylines) correctly imports from the shared vocabulary.
  • Confirmed resolveNavIcon is used in both the sidebar and the palette, and that the lazy icon cache still provides a stable component identity for uncommon Phosphor names.
  • Checked that no stale PuzzlePiece imports or fallbacks remain outside the new vocabulary module, and that the updated/added tests cover collection overrides, taxonomy tags vs. categories, plugin-page resolution, and the Plug fallback.
  • Reviewed the changeset against AGENTS.md guidance (present-tense, user-facing, patch bump for @emdash-cms/admin).

No regressions, logic bugs, AGENTS.md convention violations, or security/data issues were introduced. This is a re-review with no outstanding findings from the previous approved review; everything remains in good shape.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-rereview Author pushed changes since the last review labels Jul 20, 2026

@ascorbic ascorbic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice

@ascorbic
ascorbic merged commit f961f6e into main Jul 20, 2026
51 checks passed
@ascorbic
ascorbic deleted the admin-navigation-icons branch July 20, 2026 21:17
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.

3 participants