Skip to content

fix: replace code block with section in webhook notifier payload preview - #463

Merged
ascorbic merged 2 commits into
emdash-cms:mainfrom
sakibmd:fix/webhook-settings-crash-440
Apr 11, 2026
Merged

fix: replace code block with section in webhook notifier payload preview#463
ascorbic merged 2 commits into
emdash-cms:mainfrom
sakibmd:fix/webhook-settings-crash-440

Conversation

@sakibmd

@sakibmd sakibmd commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The webhook notifier settings page was crashing in the admin UI when opened. The error was:

TypeError: Cannot read properties of undefined (reading 'classes')

This happened because the settings page used a { type: "code", language: "json" } block to render the payload preview. This triggered the admin renderer's syntax highlighter, which crashed when it could not find the JSON language definition.

Fixed by replacing the type: "code" block with a type: "section" block that renders the payload preview as plain fenced markdown text — no syntax highlighter involved.

Issue: #440

To reproduce:

  1. Register webhookNotifierPlugin() in astro.config.mjs
  2. Open admin panel → click Webhook Notifier in the sidebar
  3. Page crashes with TypeError: Cannot read properties of undefined (reading 'classes')

To verify the fix:

  1. Apply this PR and rebuild: pnpm --filter @emdash-cms/plugin-webhook-notifier build
  2. Open admin panel → Webhook Notifier settings page
  3. Page loads normally, payload preview is visible, no console errors

Closes #440

Type of change

  • Bug fix
  • Feature (requires approved Discussion)
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm --silent lint:json | jq '.diagnostics | length' returns 0
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code

Screenshots / test output

Before: Page crashes with TypeError: Cannot read properties of undefined (reading 'classes') and shows "Something went wrong".

After: Webhook notifier settings page loads normally with the payload preview visible and zero console errors.

@changeset-bot

changeset-bot Bot commented Apr 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 08c1a27

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

This PR includes changesets to release 15 packages
Name Type
@emdash-cms/plugin-webhook-notifier Patch
emdash Patch
@emdash-cms/admin Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/cloudflare Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/plugin-ai-moderation Patch
@emdash-cms/plugin-atproto Patch
@emdash-cms/plugin-audit-log Patch
@emdash-cms/plugin-color Patch
@emdash-cms/plugin-embeds Patch
@emdash-cms/plugin-forms Patch
@emdash-cms/x402 Patch
create-emdash 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

@github-actions

github-actions Bot commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sakibmd

sakibmd commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Apr 11, 2026
@sakibmd

sakibmd commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Hello @ascorbic,

This PR resolves issue #440 — the webhook notifier settings page was crashing in the admin UI.

Could you please review it at your convenience?

Thank you

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

Thanks!

@ascorbic
ascorbic enabled auto-merge (squash) April 11, 2026 21:05
@pkg-pr-new

pkg-pr-new Bot commented Apr 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

emdash

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

create-emdash

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

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

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: 08c1a27

@ascorbic
ascorbic merged commit 701d0ca into emdash-cms:main Apr 11, 2026
25 of 26 checks passed
This was referenced Apr 11, 2026
fmhall pushed a commit to fmhall/emdash that referenced this pull request Apr 13, 2026
…iew (emdash-cms#463)

* fix: replace code block with section in webhook notifier payload preview

* chore: add changeset for webhook notifier fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment