Skip to content

fix(react): show node selection on code blocks - #698

Merged
ocavue merged 2 commits into
masterfrom
fix/code-block-node-selection
Oct 16, 2026
Merged

ocavue merged 2 commits into
masterfrom
fix/code-block-node-selection

Conversation

@ocavuebot

@ocavuebot ocavuebot commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

@prosemirror-adapter replaces prosemirror-view's selectNode, so a code block node view never gets ProseMirror-selectednode. A code block selected with the block handle showed nothing, and a math or Mermaid block, whose source is hidden behind its preview, gave no feedback at all. CodeBlockView now sets data-selected from its selected prop and draws the core node selection outline and wash.

Before After
Mermaid before mermaid after mermaid
Math before math after math
Code before code after code

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
meowdown Ignored Ignored Oct 16, 2026 2:23pm UTC

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd4f74dc-aa5e-4780-9c5a-2d3241069881
📥 Commits

Reviewing files that changed from the base of the PR and between 55940d3 and 7216286.

📒 Files selected for processing: 5
  • .changeset/code-block-node-selection.md
  • packages/react/src/components/code-block-view.module.css
  • packages/react/src/components/code-block-view.module.d.css.ts
  • packages/react/src/components/code-block-view.test.tsx
  • packages/react/src/components/code-block-view.tsx
+----------------------------------------------------------+
| Sometimes, I pretend to be a compiler to feel important. |
+----------------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 7216286

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 94.56% 5824 / 6159
🔵 Statements 92.38% 6579 / 7121
🔵 Functions 92.67% 1430 / 1543
🔵 Branches 88.68% 4521 / 5098
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/code-block-view.module.css 0% 0% 0% 0%
packages/react/src/components/code-block-view.module.d.css.ts 0% 0% 0% 0%
packages/react/src/components/code-block-view.tsx 97.95% 92.68% 100% 100% 57
Generated in workflow #2754 for commit 7216286 by the Vitest Coverage Report Action

@ocavue
ocavue marked this pull request as ready for review October 16, 2026 22:48
@ocavue
ocavue self-requested a review as a code owner October 16, 2026 22:48
@ocavue
ocavue merged commit ff21b6c into master Oct 16, 2026
13 of 14 checks passed
@ocavue
ocavue deleted the fix/code-block-node-selection branch October 16, 2026 22:48
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