Skip to content

fix: stop pausing spellcheck around edits - #451

Merged
ocavue merged 7 commits into
masterfrom
spell-check-attribute-on-mount
Aug 10, 2026
Merged

fix: stop pausing spellcheck around edits#451
ocavue merged 7 commits into
masterfrom
spell-check-attribute-on-mount

Conversation

@ocavue

@ocavue ocavue commented Aug 7, 2026

Copy link
Copy Markdown
Member

The pause from #186 also suppressed WebKit's as-you-type spell marking (WebKit checks a word the moment its boundary is typed and never re-checks it later), so set the attribute statically at mount. In its place, a new always-on guard cancels the beforeinput insertReplacementText events whose replacement contains an em dash, so the macOS smart-dashes rewrite can no longer corrupt Markdown such as the --> closing an image sizing comment.

Summary by CodeRabbit

  • Bug Fixes

    • Prevented unwanted smart-dash substitutions while editing.
    • Preserved the editor selection when system text substitutions occur.
    • Maintained spell-check settings through editor view attributes.
  • Refactor

    • Removed the previous built-in spell-check plugin and related internal utilities.
  • Performance

    • Added image dimensions to improve loading behavior for the inline demo image.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
meowdown Ready Ready Preview Aug 10, 2026 6:20am

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ocavue, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f49d28c0-007a-4a0c-8e23-9bfdb7861e3d

📥 Commits

Reviewing files that changed from the base of the PR and between 331a681 and 24da1eb.

📒 Files selected for processing (2)
  • packages/core/src/extensions/spell-check.ts
  • packages/react/src/components/editor-extensions.tsx
📝 Walkthrough

Walkthrough

The editor now guards against WebKit em-dash substitution, removes the spell-check plugin integration and utility, and preserves view attributes. The website demo reorders imports and adds image dimensions.

Changes

Editor input behavior

Layer / File(s) Summary
System substitution guard
packages/core/src/extensions/system-substitution-guard.ts, packages/core/src/extensions/extension.ts
Registers a high-priority handler for cancelable em-dash replacement events and restores the prior selection when required.
Spell-check integration removal
packages/core/src/extensions/spell-check.ts, packages/core/src/utils/is-mark-step.ts, packages/core/src/index.ts, packages/react/src/components/editor-extensions.tsx
Removes the spell-check plugin and mark-step utility. React no longer registers spell-check, and the public export is removed. View attributes now always apply the spellcheck attribute and conditionally apply the editor class.

Website demo metadata

Layer / File(s) Summary
Demo image metadata
website/src/app.tsx
Reorders React imports and adds 128×128 metadata to the inline demo image.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: maccman

Sequence Diagram(s)

sequenceDiagram
  participant EditorDOM
  participant defineSystemSubstitutionGuard
  participant ProseMirrorEditorView
  EditorDOM->>defineSystemSubstitutionGuard: beforeinput replacement with em dash
  defineSystemSubstitutionGuard->>EditorDOM: preventDefault()
  ProseMirrorEditorView->>defineSystemSubstitutionGuard: view update completes
  defineSystemSubstitutionGuard->>ProseMirrorEditorView: restore prior selection
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: spellcheck no longer pauses during edits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch spell-check-attribute-on-mount

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@meowdown/core@451
npm i https://pkg.pr.new/@meowdown/markdown@451
npm i https://pkg.pr.new/@meowdown/react@451

commit: 24da1eb

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.01% 4699 / 5052
🔵 Statements 90.7% 5281 / 5822
🔵 Functions 90.59% 1136 / 1254
🔵 Branches 86.15% 3373 / 3915
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/extensions/extension.ts 100% 100% 100% 100%
packages/core/src/extensions/spell-check.ts 2.5% 0% 0% 2.56% 11-124
packages/core/src/extensions/system-substitution-guard.ts 37.5% 16.66% 66.66% 38.46% 21, 22-34
packages/react/src/components/editor-extensions.tsx 98.3% 88.88% 100% 98.24% 111
Generated in workflow #1794 for commit 24da1eb by the Vitest Coverage Report Action

@ocavue
ocavue force-pushed the spell-check-attribute-on-mount branch from 427b15c to 331a681 Compare August 10, 2026 06:13
@ocavue ocavue changed the title fix: apply the spellcheck attribute at mount and stop pausing it around edits fix: stop pausing spellcheck around edits Aug 10, 2026
@ocavue
ocavue marked this pull request as ready for review August 10, 2026 06:15
@ocavue
ocavue force-pushed the spell-check-attribute-on-mount branch from 331a681 to 28baf94 Compare August 10, 2026 06:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/react/src/components/editor-extensions.tsx`:
- Around line 103-111: Update the effect containing defineViewAttributes so the
initial spellCheck value is captured and registered by a separate mount-only
extension before the dynamic editorClassName extension. Keep the class attribute
extension dependent on editorClassName, but ensure its cleanup cannot remove or
reapply the spellcheck attribute during an active editor session.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a98b2429-e6d7-43ee-8e64-05bac4519ed9

📥 Commits

Reviewing files that changed from the base of the PR and between cac527e and 331a681.

📒 Files selected for processing (7)
  • packages/core/src/extensions/extension.ts
  • packages/core/src/extensions/spell-check.ts
  • packages/core/src/extensions/system-substitution-guard.ts
  • packages/core/src/index.ts
  • packages/core/src/utils/is-mark-step.ts
  • packages/react/src/components/editor-extensions.tsx
  • website/src/app.tsx
💤 Files with no reviewable changes (3)
  • packages/core/src/index.ts
  • packages/core/src/extensions/spell-check.ts
  • packages/core/src/utils/is-mark-step.ts

Comment on lines +103 to +111
const attrs: { [key: string]: string } = {
spellcheck: spellCheck ? 'true' : 'false',
}
if (editorClassName) {
attrs['class'] = editorClassName
}
const extension = defineViewAttributes(attrs)
return editor.use(extension)
}, [editor, editorClassName])
}, [editor, editorClassName, spellCheck])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the changed component before inspecting relevant lifecycle usage.
ast-grep outline packages/react/src/components/editor-extensions.tsx --items all

# Inspect editor extension cleanup usage and spellcheck-related tests.
rg -n -C 6 --glob '*.ts' --glob '*.tsx' '\.use\(|spellCheck|editorClassName' packages
rg -n -C 6 --glob '*test*.ts' --glob '*test*.tsx' --glob '*spec*.ts' --glob '*spec*.tsx' \
  'EditorExtensions|spellCheck|editorClassName' packages

Repository: prosekit/meowdown

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant extension lifecycle and the static spellcheck prop handling.
sed -n '1,140p' packages/react/src/components/editor-extensions.tsx
sed -n '350,390p' packages/react/src/components/prosekit-editor.tsx
sed -n '560,605p' packages/react/src/components/prosekit-editor.tsx

# Locate and inspect the core view-attributes implementation.
fd -a 'view-attributes' .
rg -n 'defineViewAttributes|viewAttributes|editorClassName' packages/core/src packages/react/src

# Inspect the exact core test around cleanup.
sed -n '1,60p' packages/core/src/extensions/view-attributes.test.ts

Repository: prosekit/meowdown

Length of output: 11149


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the view-attributes implementation and React integration.
sed -n '1,90p' packages/core/src/extensions/view-attributes.ts
rg -n -C 3 'function useExtension|export function useExtension|defineViewAttributes|spellcheck' packages/react/src packages/core/src -g '*.ts' -g '*.tsx'

# Read the static spellCheck handling from ProseKitEditor.
sed -n '540,560p' packages/react/src/components/prosekit-editor.tsx
sed -n '354,398p' packages/react/src/components/prosekit-editor.tsx

Repository: prosekit/meowdown

Length of output: 10669


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find useExtension in installed dependencies without mutating files.
git ls-files packages/react/src | xargs rg -n 'useExtension' || true
find node_modules/@prosekit/react -maxdepth 10 -type f \( -name '*.js' -o -name '*.mjs' \) 2>/dev/null | xargs rg -n 'function useExtension|export .*useExtension' || true
fd -a -e js -e mjs -e cjs 'prosekit' node_modules 2>/dev/null | head -50 || true

# Inspect ProseKitEditor static spellCheck handling around EditorExtensions prop.
sed -n '354,398p' packages/react/src/components/prosekit-editor.tsx

Repository: prosekit/meowdown

Length of output: 4992


Keep the spellcheck attribute extension mount-only.

Changing editorClassName reruns this effect, and the returned cleanup removes the view-attributes extension that also owns spellcheck. That removes and reapplies spellcheck during an active editor session. Store the initial spellCheck value and register a separate mount-only spellcheck extension from it before the dynamic editorClassName extension.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react/src/components/editor-extensions.tsx` around lines 103 - 111,
Update the effect containing defineViewAttributes so the initial spellCheck
value is captured and registered by a separate mount-only extension before the
dynamic editorClassName extension. Keep the class attribute extension dependent
on editorClassName, but ensure its cleanup cannot remove or reapply the
spellcheck attribute during an active editor session.

@ocavue
ocavue merged commit 563162c into master Aug 10, 2026
12 checks passed
@ocavue
ocavue deleted the spell-check-attribute-on-mount branch August 10, 2026 06:24
@ocavuebot ocavuebot mentioned this pull request Aug 10, 2026
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.

1 participant