Skip to content

fix(super-editor): handle SuperDoc context-menu paste (SD-2934)#3131

Merged
caio-pizzol merged 2 commits intomainfrom
caio/sd-2934-context-menu-paste-inserts-hidden-copy-data
May 5, 2026
Merged

fix(super-editor): handle SuperDoc context-menu paste (SD-2934)#3131
caio-pizzol merged 2 commits intomainfrom
caio/sd-2934-context-menu-paste-inserts-hidden-copy-data

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol commented May 4, 2026

Summary

Fixes SD-2934. Related intake: IT-1003.

Context-menu paste now mirrors native paste for SuperDoc-origin clipboard HTML. It extracts embedded slice, media, and body-section data from the original HTML, imports/remaps referenced image media, strips hidden SuperDoc metadata before HTML fallback, and keeps SuperDoc-origin HTML out of the DOCX converter path.

Root cause

SuperDoc copy embeds hidden slice data in text/html so structured content can round-trip. Native paste consumes or strips that hidden data, but context-menu Paste reads clipboard HTML through the async clipboard API and previously treated the full HTML as generic browser HTML. That allowed the hidden base64 slice payload to be parsed as document text. The async clipboard path also cannot read SuperDoc's custom media MIME, so image media must ride along in the HTML payload too.

Validation

  • pnpm exec vitest run --root ./packages/super-editor src/editors/v1/core/helpers/superdocClipboardSlice.test.js
  • pnpm exec vitest run --root ./packages/super-editor src/editors/v1/core/InputRule.test.js
  • pnpm exec vitest run --root ./packages/super-editor src/editors/v1/components/context-menu/tests/menuItems.test.js src/editors/v1/components/context-menu/menuItems.test.js
  • pnpm --filter superdoc build:dev
  • pnpm --dir tests/behavior exec playwright test tests/slash-menu/paste.spec.ts --project=chromium
  • git diff --check

@linear
Copy link
Copy Markdown

linear Bot commented May 4, 2026

@caio-pizzol caio-pizzol marked this pull request as ready for review May 4, 2026 21:02
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 4, 2026 21:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e68021d97

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/super-editor/src/editors/v1/core/InputRule.js Outdated
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol force-pushed the caio/sd-2934-context-menu-paste-inserts-hidden-copy-data branch from 0e68021 to d083235 Compare May 4, 2026 23:41
@caio-pizzol caio-pizzol changed the title fix: handle SuperDoc context-menu paste fix(super-editor): handle SuperDoc context-menu paste (SD-2934) May 4, 2026
@caio-pizzol caio-pizzol force-pushed the caio/sd-2934-context-menu-paste-inserts-hidden-copy-data branch from d083235 to a916039 Compare May 4, 2026 23:43
@caio-pizzol caio-pizzol merged commit 519da2a into main May 5, 2026
67 checks passed
@caio-pizzol caio-pizzol deleted the caio/sd-2934-context-menu-paste-inserts-hidden-copy-data branch May 5, 2026 00:19
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.43

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.87

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.85

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in superdoc v1.30.0-next.44

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.61

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 5, 2026

🎉 This PR is included in superdoc-sdk v1.8.0-next.46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants