Skip to content

feat(editor): ensure EmailTheming presence in Inspector.Provider#3175

Draft
gabrielmfern wants to merge 3 commits intocanaryfrom
cursor/inspector-theming-validation-f862
Draft

feat(editor): ensure EmailTheming presence in Inspector.Provider#3175
gabrielmfern wants to merge 3 commits intocanaryfrom
cursor/inspector-theming-validation-f862

Conversation

@gabrielmfern
Copy link
Copy Markdown
Member

@gabrielmfern gabrielmfern commented Apr 2, 2026

Summary

Adds a runtime validation check in Inspector.Provider that throws an error if the EmailTheming extension is not registered on the editor. Previously, if a developer forgot to add EmailTheming to their editor extensions, the Inspector.Document component would silently return null, making it difficult to debug. Now, a clear error message is thrown instructing the user to add the extension.

Changes

  • packages/editor/src/ui/inspector/provider.tsx: Added a check at the top of InspectorProvider that verifies the 'theming' extension (i.e. EmailTheming) is present in the editor's extension manager. If missing, throws an Error with an actionable message.

This follows the existing validation pattern used in useInspector, useBubbleMenuContext, and useNodeSelectorContext which throw errors for missing providers/contexts.

Slack Thread

Open in Web Open in Cursor 

Summary by cubic

Add a runtime validation in Inspector.Provider to ensure the editor registers EmailTheming. If missing, we throw a clear error instead of Inspector.Document returning null.

  • Refactors
    • Validate the 'theming' extension during render using editor.extensionManager.extensions, and throw an actionable error if missing.

Written for commit b43b4d0. Summary will update on new commits.

Throws an error when Inspector.Provider is rendered without the
EmailTheming extension registered on the editor. This gives developers
a clear message instead of silently returning null in Inspector.Document.

Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

⚠️ No Changeset found

Latest commit: b43b4d0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Apr 2, 2026 8:41pm
react-email-demo Ready Ready Preview, Comment Apr 2, 2026 8:41pm
react-email-examples Ready Ready Preview, Comment Apr 2, 2026 8:41pm

Request Review

@gabrielmfern gabrielmfern changed the title feat(editor): Validate EmailTheming presence in Inspector.Provider feat(editor): ensure EmailTheming presence in Inspector.Provider Apr 2, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@react-email/editor@3175

commit: b43b4d0

Co-authored-by: Gabriel Miranda <gabrielmfern@outlook.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/editor/src/ui/inspector/provider.tsx">

<violation number="1" location="packages/editor/src/ui/inspector/provider.tsx:134">
P2: This invariant check is delayed to `useEffect`, so the provider can render once without `EmailTheming` before throwing. Keep this validation in render to fail fast.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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.

2 participants