fix(admin): use the configured Site Icon as the admin favicon#1505
fix(admin): use the configured Site Icon as the admin favicon#1505swissky wants to merge 3 commits into
Conversation
🦋 Changeset detectedLatest commit: 013c8ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 |
@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/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: |
|
/review |
| // Settings unavailable (e.g. pre-setup) — fall back to the config/default. | ||
| } | ||
| } | ||
| const favicon = siteFavicon ?? adminConfig?.favicon; |
There was a problem hiding this comment.
Shouldn't it default to the admin favicon? That's more specific than the site one.
There was a problem hiding this comment.
Good call — agreed. An explicitly configured admin.favicon is admin-specific and shouldn't be silently overridden by the more general Site Icon. I've flipped the precedence to adminConfig?.favicon ?? siteFavicon (admin.favicon → Site Icon → bundled mark). The Site Icon still brands the admin in the common case where no admin.favicon is set, which was the goal of the PR. Comment + changeset updated, and rebased on latest main.
Address review: an explicitly configured build-time admin.favicon is admin-specific and should not be overridden by the more general Site Icon. Flip precedence to admin.favicon -> Site Icon -> bundled mark. The Site Icon still brands the admin for the common case where no admin.favicon is set.
6c2d8fa to
ec7f8c6
Compare
| // Settings unavailable (e.g. pre-setup) — fall back to the config/default. | ||
| } | ||
| } | ||
| const favicon = adminConfig?.favicon ?? siteFavicon; |
There was a problem hiding this comment.
As we're defaulting to adminConfig?.favicon we could skip getting siteFavicon if it's present
There was a problem hiding this comment.
Done — the settings read is now skipped entirely when an explicit admin.favicon is configured (013c8ad), so the common self-hosted case with a build-time favicon no longer pays the per-request settings lookup.
What does this PR do?
The admin shell (
admin.astro) sets its favicon only from the build-timeadmin.faviconconfig, falling back to the bundled EmDash mark. The Site Icon users configure in Settings → General (thefaviconsite setting) was ignored by the backend — even though the public site already uses it viaEmDashHead(renderSiteIdentity({ favicon: siteSettings.favicon })).So setting a Site Icon brands the public site but not the admin — unlike WordPress, where the Site Icon also brands
wp-admin.This loads the site settings at request time and prefers the configured Site Icon for the admin
<link rel="icon">:Site Icon (Settings → General) → build-time
admin.favicon→ bundled EmDash markNo behaviour change when no Site Icon is set (the existing config/default fallback still applies). Wrapped in try/catch so a pre-setup or settings error can't break the admin shell.
Closes #
Type of change
Checklist
pnpm typecheckpasses (emdashpackage — ran clean)pnpm lintpasses (left to CI)pnpm testpasses — n/a: change is in an Astro route<head>template (no unit harness); behaviour verified manuallypnpm formathas been run (left to CI)AI-generated code disclosure
Screenshots / test output
Single-file change in
packages/core/src/astro/routes/admin.astro(+ changeset). Reuses the existinggetSiteSettingsWithDbloader (same import the sitemap route uses).pnpm --filter emdash typecheckis clean.