Skip to content

fix: block typing over the divider block#3502

Merged
dielduarte merged 4 commits into
canaryfrom
feature/dev-632-its-possible-to-just-type-over-the-divider
May 13, 2026
Merged

fix: block typing over the divider block#3502
dielduarte merged 4 commits into
canaryfrom
feature/dev-632-its-possible-to-just-type-over-the-divider

Conversation

@dielduarte
Copy link
Copy Markdown
Contributor

@dielduarte dielduarte commented May 13, 2026

Description

This PR adds a new ProseMirror plugin to the divider extension that blocks any transactions adding content (like type) over the divider.

I also had to update the bubble trigger to stop appearing in this case, so by default it's now the button and divider, but the user can override it by passing the prop hideWhenActiveNodes as before.

Video showing it working:
https://www.loom.com/share/cf524b2cba48449b91931fdf5532dc4e


Summary by cubic

Blocks typing over the divider (horizontalRule) and hides the bubble menu when it’s selected to prevent accidental edits. Addresses Linear DEV-632.

  • Bug Fixes
    • Added a ProseMirror plugin in the divider extension that blocks insert/replace when a horizontalRule is node-selected; Backspace still deletes it.
    • Updated bubble menu triggers to check NodeSelection; the menu hides when horizontalRule is selected.
    • Set default BubbleMenu hideWhenActiveNodes to ['button', 'horizontalRule'].
    • Added tests to ensure typing doesn’t replace the divider and Backspace deletes it.

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 13, 2026

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

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment May 13, 2026 4:51pm
react-email-demo Ready Ready Preview, Comment May 13, 2026 4:51pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 4346632

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

This PR includes changesets to release 1 package
Name Type
@react-email/editor 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
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

Open in StackBlitz

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

commit: 4346632

@dielduarte dielduarte force-pushed the feature/dev-632-its-possible-to-just-type-over-the-divider branch from bd14cd6 to b8f60f6 Compare May 13, 2026 16:13
Comment thread apps/web/src/app/editor/full-email-builder/example.tsx Outdated
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.

cubic analysis

No issues found across 5 files

Confidence score: 5/5

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

Linked issue analysis

Linked issue: DEV-632: It's possible to just type over the divider

Status Acceptance criteria Notes
Prevent transactions that insert content (typing) from replacing a horizontal rule when the divider is node-selected A ProseMirror plugin was added that filters transactions when the selection is a NodeSelection on a 'horizontalRule' and rejects ReplaceStep instances that insert content. Tests were added asserting typing does not replace the divider.
Hide the bubble menu by default when the divider (horizontalRule) is active/selected (while preserving the ability to override via hideWhenActiveNodes) The bubble-menu trigger now returns false when the current selection is a NodeSelection whose node type is included in hideWhenActiveNodes. The default hideWhenActiveNodes was updated to include 'horizontalRule' in both the example and EmailEditor, preserving the prop override behavior.

Auto-approved: This PR adds a ProseMirror plugin to block typing over the divider while still allowing deletion, with updated bubble menu defaults and tests, all within the email editor's isolated extension system.

dielduarte and others added 4 commits May 13, 2026 13:51
@dielduarte dielduarte force-pushed the feature/dev-632-its-possible-to-just-type-over-the-divider branch from 2553f65 to 4346632 Compare May 13, 2026 16:51
@dielduarte dielduarte merged commit 5c6c805 into canary May 13, 2026
14 of 15 checks passed
@dielduarte dielduarte deleted the feature/dev-632-its-possible-to-just-type-over-the-divider branch May 13, 2026 16:54
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