Skip to content

feat(admin): fall back to the site title for admin branding#1707

Merged
ascorbic merged 1 commit into
emdash-cms:mainfrom
swissky:feat/admin-sidebar-site-title
Jul 2, 2026
Merged

feat(admin): fall back to the site title for admin branding#1707
ascorbic merged 1 commit into
emdash-cms:mainfrom
swissky:feat/admin-sidebar-site-title

Conversation

@swissky

@swissky swissky commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The admin sidebar header (and the version line in its footer) always shows the hardcoded "EmDash" label unless a build-time admin.siteName is configured. Operators running several EmDash backends can't tell at a glance which site's admin they're in — every tab looks identical.

This adds a WordPress-style fallback in the manifest route: when no explicit admin.siteName is configured, manifest.admin.siteName is filled from the site's own title. Precedence:

build-time admin.siteName → Site Title (Settings → General, site:title) → the title captured by the setup wizard (emdash:site_title) → the bundled "EmDash" default in the SPA

The admin SPA is untouched — the sidebar already renders manifest.admin?.siteName || "EmDash", so the header, footer, and BrandIcon alt text all pick this up automatically. Both option keys are read with a single getMany batch, wrapped in try/catch so a pre-setup database keeps the default. No behavior change for sites that configure admin.siteName or have no title yet.

Complements #1505 (Site Icon as the admin favicon): favicon + sidebar title together make each backend instantly recognizable.

Discussion: #1706

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 (emdash package — clean)
  • pnpm lint passes (oxlint --type-aware --deny-warnings clean on the changed file)
  • pnpm test passes (or targeted tests for my change) — n/a: single manifest-route fallback with no existing route test harness; behavior verified manually
  • pnpm format has been run (oxfmt + prettier clean)
  • I have added/updated tests for my changes (if applicable) — see above
  • User-visible strings in the admin UI are wrapped for translation (if applicable) — n/a, no strings added; no messages.po changes
  • I have added a changeset (emdash: minor)
  • New features link to an approved Discussion — Show the site title in the admin instead of the generic EmDash mark #1706 (opened for maintainer approval)

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Cursor + Claude Fable 5

Screenshots / test output

Single-file change in packages/core/src/astro/routes/api/manifest.ts (+ changeset). Reuses the existing OptionsRepository.getMany batch read.

@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9a479eb

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

This PR includes changesets to release 16 packages
Name Type
emdash Minor
@emdash-cms/cloudflare Minor
@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/admin Minor
@emdash-cms/auth Minor
@emdash-cms/blocks Minor
@emdash-cms/gutenberg-to-portable-text Minor
@emdash-cms/x402 Minor
create-emdash Minor
@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

@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 9a479eb

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

Sounds good

@ascorbic ascorbic merged commit e4eab4f into emdash-cms:main Jul 2, 2026
45 checks passed
@emdashbot emdashbot Bot mentioned this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants