Skip to content

improvement(rich-markdown-editor): strict inline-mark paste, table column-resize cursor, docs#5455

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/table-resize-cursor
Jul 7, 2026
Merged

improvement(rich-markdown-editor): strict inline-mark paste, table column-resize cursor, docs#5455
waleedlatif1 merged 4 commits into
stagingfrom
fix/table-resize-cursor

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix: table column borders now show the col-resize cursor on hover. prosemirror-tables toggles a resize-cursor class on the editor while the pointer is over a column boundary, but there was no CSS rule to change the cursor — the blue resize handle appeared with no cursor affordance. Added one scoped rule (.rich-markdown-prose.resize-cursor { cursor: col-resize }).
  • Tests: exhaustive coverage for markdown paste — every rich construct (headings, marks, lists, task lists, blockquote, fenced code, image, thematic break, table), markdown parsed even when the clipboard carries an HTML sibling, multi-block order preservation, read-only rejection, and the defer/verbatim cases for non-markdown input.
  • Docs: new rich markdown editor page under Files, with a rendered overview screenshot.

Type of Change

  • Bug fix
  • Test coverage
  • Documentation

Testing

  • Column-resize cursor verified empirically against the real stylesheet (base → not col-resize; plugin class present → col-resize; scoped, no leak).
  • Paste behavior verified end-to-end in a real browser harness (19 cases) and mirrored into the committed unit tests, which follow the existing CI-passing pattern.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

… borders

prosemirror-tables toggles a `resize-cursor` class on the editor while the pointer is over a
column boundary, but there was no rule to change the cursor — the blue resize handle showed with
no cursor affordance. Add the scoped `col-resize` rule.
Cover every rich construct (headings, marks, lists, task lists, blockquote, code block, image,
thematic break, table), markdown parsed despite an HTML sibling, multi-block order, read-only
rejection, and the defer/verbatim cases for non-markdown input.
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 7, 2026 1:06am

Request Review

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation and test-only expansion plus a scoped CSS cursor rule; no application logic changes.

Overview
Adds a Files → Editor docs page that explains the rich markdown file editor (formatting, structure, tables, paste, read-only edge cases) and wires it into the docs nav after Files index.

Fixes table column resize UX: when prosemirror-tables adds resize-cursor on the editor root, .rich-markdown-prose.resize-cursor now sets cursor: col-resize so the handle matches the affordance.

Expands markdown-paste.test.ts: mount(editable) for read-only paste rejection; parameterized cases for inputs that defer to the default handler vs. rich structural paste; HTML+plain-text paste; multi-block order preservation. No production paste logic changes in this diff.

Reviewed by Cursor Bugbot for commit 5581443. Configure here.

Document the inline rich markdown editor — formatting, structure, lists, tables, code blocks,
images, the slash menu, and markdown fidelity — with a rendered overview screenshot.
@waleedlatif1 waleedlatif1 changed the title fix(rich-markdown-editor): table column-resize cursor + exhaustive paste tests improvement(rich-markdown-editor): table column-resize cursor, exhaustive paste tests, editor docs Jul 7, 2026
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes three independent improvements to the rich markdown editor: a one-line CSS bug fix that adds the col-resize cursor affordance when prosemirror-tables is in column-resize mode, expanded test coverage for the MarkdownPaste extension (19 cases covering every structural markdown construct, read-only rejection, multi-block ordering, and disambiguation from the default handler), and a new documentation page for the editor feature.

  • CSS fix: .rich-markdown-prose.resize-cursor { cursor: col-resize; } is placed correctly adjacent to the existing .column-resize-handle rule and scoped to avoid leaking.
  • Tests: The mount(editable) helper is extended, three previously-misclassified inline marks (*italic*, ~~struck~~, `code`) are moved to the "leaves to default handler" group (matching the looksLikeMarkdown intentional omissions), and nine structural constructs are verified to return true with the correct TipTap node type in the editor JSON.
  • Docs: New editor.mdx page inserted into the sidebar between the files index and using-in-workflows; the two Card cross-links both resolve to existing pages.

Confidence Score: 5/5

Safe to merge — all three changes are narrowly scoped, independently correct, and carry no cross-cutting side-effects.

The CSS addition is a single, well-scoped rule that fixes a missing cursor affordance without touching any shared selector. The test expansion correctly reclassifies the three inline marks that were previously misassigned and verifies every structural construct the extension gates on. The docs page adds navigation only (the sidebar entry and two cross-links that already exist) with no runtime code changes.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.css Adds .rich-markdown-prose.resize-cursor { cursor: col-resize; } scoped rule to wire up the missing cursor affordance for prosemirror-tables column resizing; no issues.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/markdown-paste.test.ts Adds 13 new test cases: read-only rejection, 6 "leave to default handler" entries (now correctly separated from the rich-render group), 9 structural construct renders, HTML-sibling preference, and multi-block order preservation — all consistent with how MarkdownPaste gates on looksLikeMarkdown.
apps/docs/content/docs/en/files/editor.mdx New documentation page for the rich markdown editor; both Card cross-links resolve to existing pages in the sidebar; content accurately describes the feature surface.
apps/docs/content/docs/en/meta.json Inserts ./files/editor into the sidebar after the files index; insertion position is correct and matches the intended navigation flow.
apps/docs/public/static/files/editor/overview.png New binary screenshot asset for the docs page; referenced correctly by the MDX <Image> component.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ClipboardEvent fires] --> B{Editor editable?}
    B -- No --> C[return false]
    B -- Yes --> D{Cursor inside code block?}
    D -- Yes --> C
    D -- No --> E[Read text/plain from clipboard]
    E --> F{looksLikeMarkdown?}
    F -- No --> C
    F -- Yes --> G[Parse via @tiptap/markdown]
    G --> H[Insert as rich ProseMirror content]
    H --> I[return true]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[ClipboardEvent fires] --> B{Editor editable?}
    B -- No --> C[return false]
    B -- Yes --> D{Cursor inside code block?}
    D -- Yes --> C
    D -- No --> E[Read text/plain from clipboard]
    E --> F{looksLikeMarkdown?}
    F -- No --> C
    F -- Yes --> G[Parse via @tiptap/markdown]
    G --> H[Insert as rich ProseMirror content]
    H --> I[return true]
Loading

Reviews (2): Last reviewed commit: "test(rich-markdown-editor): scope paste ..." | Re-trigger Greptile

…ctually gates

Inline-only marks (single-asterisk italic, ~~, single-backtick code) are intentionally not detected
by looksLikeMarkdown (single `*` would false-positive on e.g. `*args`); they route through the
Markdown extension's own paste path, not MarkdownPaste. Move them from the rich-render cases to the
defers-to-default cases so the suite tests the handler it names.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 5581443. Configure here.

@waleedlatif1 waleedlatif1 merged commit 7191792 into staging Jul 7, 2026
18 checks passed
@waleedlatif1 waleedlatif1 changed the title improvement(rich-markdown-editor): table column-resize cursor, exhaustive paste tests, editor docs improvement(rich-markdown-editor): strict inline-mark paste, table column-resize cursor, docs Jul 7, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Added a real paste-correctness fix in 6dc3100e21: inline-mark pastes (*italic*, ~~strike~~, code) now route through the strict CommonMark parser (marked via parseMarkdownToDoc) instead of StarterKit's lenient mark paste rules. Real emphasis renders; code-like text like 5 * width * height and def foo(*args, **kwargs) stays literal — matching Obsidian/Linear. Verified across 21 browser-harness cases + committed unit tests.

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