Skip to content

fix(admin): show OG image picker for any SEO-enabled collection - #957

Merged
ascorbic merged 2 commits into
mainfrom
fix/seo-og-image-in-panel
May 8, 2026
Merged

ascorbic merged 2 commits into
mainfrom
fix/seo-og-image-in-panel

Conversation

@ascorbic

@ascorbic ascorbic commented May 8, 2026

Copy link
Copy Markdown
Member

What does this PR do?

The OG image control was rendered inline next to a content field whose slug had to be literally featured_image. Collections without that exact field (e.g. typical Pages) had no way to set a social preview image even with SEO enabled in the schema -- the SeoPanel sidebar only shows Title / Description / Canonical / NoIndex.

This PR moves the OG image picker into SeoPanel itself so it appears in the sidebar alongside the other SEO fields, decoupled from the schema. Any collection with seo: true in supports now gets the picker, regardless of which fields it has.

The picker is the same SeoImageField component as before; only its mount point changed. Server-side handling is unchanged -- SeoImageField still emits a partial { image: url }, and the existing SeoRepository.upsert correctly preserves other columns when image is the only key.

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

Visual check confirmed by maintainer locally.

Test output:

✓ tests/components/SeoPanel.test.tsx (7 tests)
   ✓ renders an OG image control regardless of collection fields
   ✓ renders the existing OG image preview when set
   ✓ debounces text field saves
   ✓ saves noindex changes immediately
   ✓ does not overwrite newer local text when stale props arrive
   ✓ resets when switching to a different content item
   ✓ flushes pending text changes on unmount

The OG image control was rendered inline next to a content field whose
slug was literally `featured_image`. Collections without that exact
field (e.g. typical Pages) had no way to set a social preview image
even with SEO enabled.

Move the picker into SeoPanel so it appears in the sidebar alongside
the other SEO fields, decoupled from the schema.
Copilot AI review requested due to automatic review settings May 8, 2026 16:32
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 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 4b76e5e May 08 2026, 07:24 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 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-perf-coordinator 4b76e5e May 08 2026, 07:23 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 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-i18n 4b76e5e May 08 2026, 07:23 PM

@changeset-bot

changeset-bot Bot commented May 8, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4b76e5e

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

cloudflare-workers-and-pages Bot commented May 8, 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 4b76e5e May 08 2026, 07:24 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 8, 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 4b76e5e May 08 2026, 07:25 PM

@pkg-pr-new

pkg-pr-new Bot commented May 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

emdash

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

create-emdash

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

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

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 4b76e5e

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

This PR fixes a limitation in the admin content editor where the OG image picker was only available when a collection had an image field literally named featured_image. It relocates the OG image control into the SeoPanel sidebar so any SEO-enabled collection can set a social preview image.

Changes:

  • Render SeoImageField inside SeoPanel so the OG image picker appears alongside other SEO fields.
  • Remove the special-case OG image rendering logic tied to the featured_image field in ContentEditor.
  • Update SeoPanel component tests to include react-query context and add coverage for the OG image control/preview.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/admin/tests/components/SeoPanel.test.tsx Adds a QueryClient wrapper for tests and new assertions ensuring OG image UI renders in the panel.
packages/admin/src/components/SeoPanel.tsx Mounts SeoImageField in the SEO sidebar panel.
packages/admin/src/components/ContentEditor.tsx Removes the inline OG image picker that depended on a featured_image field.
.changeset/seo-og-image-in-panel.md Adds a patch changeset documenting the bug fix and new behavior.

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

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@ascorbic
ascorbic enabled auto-merge (squash) May 8, 2026 19:22
@ascorbic
ascorbic merged commit 13ff061 into main May 8, 2026
36 checks passed
@ascorbic
ascorbic deleted the fix/seo-og-image-in-panel branch May 8, 2026 19:30
@emdashbot emdashbot Bot mentioned this pull request May 8, 2026
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