Skip to content

Normalize markdown and richtext editor field handling#687

Open
bobbwal wants to merge 1 commit intoSonicJs-Org:mainfrom
bobbwal:fix/markdown-editor-type-normalization
Open

Normalize markdown and richtext editor field handling#687
bobbwal wants to merge 1 commit intoSonicJs-Org:mainfrom
bobbwal:fix/markdown-editor-type-normalization

Conversation

@bobbwal
Copy link
Contributor

@bobbwal bobbwal commented Mar 14, 2026

Description

Normalizes editor field handling so markdown becomes the canonical markdown field type, while mdxeditor and easymde remain supported aliases. This also fixes editor provider scoping, schema-backed field resolution, and a few related admin form regressions uncovered during review.

Fixes #569
Fixes #674
Supersedes PR #570

Changes

  • Make markdown the canonical markdown field type in types, admin collection editing, and docs
  • Keep mdxeditor and easymde working as compatibility aliases
  • Scope TinyMCE and EasyMDE initialization to the correct editor provider to prevent cross-binding
  • Preserve canonical richtext as the TinyMCE-backed default rich text type
  • Normalize tinymce back to richtext in the admin collection editor flow so schemas round-trip safely
  • Fix schema-backed content field resolution so:
    • format: 'richtext' renders via the richtext path instead of a plain text input
    • enum-backed string fields resolve to select and keep their options
  • Restore explicit fallback warnings/textarea behavior when TinyMCE or the markdown editor plugin is inactive
  • Add/update docs for the normalized field type model
  • Add focused unit and Playwright regression coverage for markdown/richtext/select behavior

Testing

  • npm run type-check
  • npm test --workspace=packages/core -- dynamic-field-extended.test.ts admin-content-field-types.test.ts admin-collections-field-types.test.ts
  • BASE_URL=http://localhost:8787 npx playwright test tests/e2e/60-markdown-field-type.spec.ts --config tests/ playwright.config.ts
  • BASE_URL=http://localhost:8787 npx playwright test tests/e2e/61-richtext-field-type.spec.ts --config tests/ playwright.config.ts

Unit Tests

  • Added/updated unit tests
  • All unit tests passing

E2E Tests

  • Added/updated E2E tests
  • Targeted E2E tests passing

Screenshots/Videos

  • None

Checklist

  • Code follows project conventions
  • Tests added/updated and passing
  • Type checking passes
  • No console errors or warnings
  • Documentation updated (if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Docs conflict on EasyMDE/MDX field types and plugin naming (easy-mdx vs easymde-editor) Missing rich‑text field types in FieldType union

1 participant