Skip to content

feat: support resource replacement in CodeMirror - #1271

Open
Maxxich wants to merge 1 commit into
feat/resource-replacement-prosemirrorfrom
feat/resource-replacement-codemirror
Open

Maxxich wants to merge 1 commit into
feat/resource-replacement-prosemirrorfrom
feat/resource-replacement-codemirror

Conversation

@Maxxich

@Maxxich Maxxich commented Sep 24, 2026 •

Copy link
Copy Markdown

Depends on PR: feat: support resource replacement in ProseMirror

Parse inserted Markdown fragments using shared editor dependencies and serialize
the current document when applying replacements. Guard local history while requests
are queued or pending, validate service dispatch, and release completed operations
with effect-only cleanup. Include Markdown, history, cleanup and standalone CM tests.

Summary by Sourcery

Support asynchronous resource replacement in CodeMirror while protecting local history and validating replacement lifecycle operations.

New Features:

  • Add CodeMirror resource replacement support for pasted and dropped Markdown resources using the shared parser and serializer.
  • Support asynchronous replacement application with validation, history isolation, and integration with the resource replacement controller.

Bug Fixes:

  • Prevent local undo and redo from bypassing queued or pending resource replacement operations.
  • Ensure completed, rejected, failed, or destroyed operations release their temporary state without affecting other operations.
  • Reject replacement requests when the editor changes, dispatch is filtered or overridden, or the editor is no longer editable.

Enhancements:

  • Expose CodeMirror history-lock state and make undo/redo commands and depth queries respect it.
  • Add standalone Markdown resource collection and replacement utilities with support for configured resource types, URL validation, opaque identifiers, and precise text changes.

Tests:

  • Add comprehensive CodeMirror regression, Markdown processing, history-lock, cleanup, dispatch-contract, and integration coverage.

@gravity-ui

gravity-ui Bot commented Sep 24, 2026

Copy link
Copy Markdown

Storybook Deployed

@gravity-ui

gravity-ui Bot commented Sep 24, 2026

Copy link
Copy Markdown

🎭 Playwright Report

@Maxxich
Maxxich marked this pull request as ready for review September 24, 2026 10:49

@sourcery-ai sourcery-ai 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.

Sorry @Maxxich, your pull request is larger than the review limit of 150,000 diff characters

@Maxxich
Maxxich changed the base branch from main to feat/resource-replacement-prosemirror October 5, 2026 09:06
@d3m1d0v
d3m1d0v added this pull request to stack #1320 October 5, 2026 13:17

This branch has not been deployed

No deployments
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