Skip to content

feat: mark horizontal scrollers with data-scroll-x - #752

Merged
ocavue merged 2 commits into
masterfrom
ocavuebot/scroll-x
Oct 30, 2026
Merged

ocavue merged 2 commits into
masterfrom
ocavuebot/scroll-x

Conversation

@ocavuebot

@ocavuebot ocavuebot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Code blocks and math and Mermaid previews scroll horizontally on their own. They now carry a stable data-scroll-x attribute in the editor and the read-only MarkdownView, so a host page can select them without test IDs or hashed CSS module classes. For example, a host whose content only pans vertically can give [data-scroll-x] back touch-action: auto. The core toDOM leaves it out, so copied HTML stays clean.

Summary by CodeRabbit

  • New Features
    • Code blocks, math renderings, and Mermaid diagrams are now marked for horizontal scrolling.

@vercel

vercel Bot commented Oct 30, 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 30, 2026 12:06pm UTC

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c59ea8f-19ac-43f2-9a7c-9b737558f7c2
Commits

Reviewing files that changed from the base of the PR and between 8dc51b9 and 6b309e0.

Files selected for processing: 1
  • .changeset/scroll-x-attribute.md
Files with no reviewable changes: 1
  • .changeset/scroll-x-attribute.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

React code-block, math, and Mermaid previews now receive data-scroll-x. Math and Mermaid renderers accept and forward the attribute. A patch changeset records the update.

Changes: Preview markers

Layer / File(s) Summary
Propagate the horizontal-scroll attribute
packages/react/src/components/math-render.tsx, packages/react/src/components/mermaid-render.tsx, packages/react/src/components/code-block-view.tsx, packages/react/src/components/markdown-view.tsx, .changeset/scroll-x-attribute.md
Math and Mermaid renderers accept and forward data-scroll-x. Code-block, math, and Mermaid previews receive the attribute in both rendering paths. The changeset records a patch release for @meowdown/react.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to 6b309

The intended previews can be selected with data-scroll-x without adding the attribute to copied HTML. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 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: adding the data-scroll-x attribute to horizontal scrollers.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 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 30, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 6b309e0

@ocavue
ocavue marked this pull request as ready for review October 30, 2026 12:02
@ocavue
ocavue self-requested a review as a code owner October 30, 2026 12:02
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 93.36% 6576 / 7043
🔵 Statements 92.1% 8053 / 8743
🔵 Functions 89.61% 1450 / 1618
🔵 Branches 88.28% 5427 / 6147
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/components/code-block-view.tsx 99.2% 92.55% 100% 100% 60
packages/react/src/components/markdown-view.tsx 97.71% 81.97% 100% 98.75% 276, 280, 448, 528-530, 532, 603, 743, 792
packages/react/src/components/math-render.tsx 95.45% 81.81% 100% 100% 30
packages/react/src/components/mermaid-render.tsx 97.77% 86.2% 100% 96.77% 44
Generated in workflow #2969 for commit 6b309e0 by the Vitest Coverage Report Action

@ocavue
ocavue merged commit f346dab into master Oct 30, 2026
15 checks passed
@ocavue
ocavue deleted the ocavuebot/scroll-x branch October 30, 2026 12:28
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