Repository navigation
docs(openspec): propose clipboard paste for plain text and EditorJS payload - #191
Draft
ilyamore88 wants to merge 2 commits into
Draft
ilyamore88 wants to merge 2 commits into
ilyamore88 wants to merge 2 commits into
Conversation
gohabereg
reviewed
Oct 3, 2026
|
|
||
| ## What Changes | ||
|
|
||
| - Add `api.document.group(fn)` to the SDK `DocumentAPI` contract and implement it in core. Model changes made synchronously inside `fn` by the local user form exactly one undo step: |
Member
There was a problem hiding this comment.
I'm not clear why do we need to expose this to the public API
ilyamore88
force-pushed
the
claude/clipboard-paste-research-2c2573
branch
from
October 10, 2026 11:49
0b07cc4 to
0922150
Compare
ilyamore88
changed the base branch from
main
to
claude/undo-grouping-proposal
October 10, 2026 11:49
ilyamore88
added this pull request to stack #202
October 10, 2026 11:49
Contributor
Unit Tests
Mutation Tests
|
Contributor
Unit Tests
Mutation Tests
|
ilyamore88
force-pushed
the
claude/clipboard-paste-research-2c2573
branch
from
October 10, 2026 12:00
0922150 to
3194244
Compare
…ayload Add the clipboard-paste-plain-and-editorjs OpenSpec change: paste of text/plain and application/x-editor-js in ClipboardPlugin, id-free copy payload, and the whole-block rule for the EditorJS payload. Builds on undo-grouping (#137).
Drop api.document.group from the clipboard paste change: the paste is applied synchronously in the ui:paste handler and undo-group-by-task records it as one undo step.
ilyamore88
removed this pull request from stack #202
October 10, 2026 12:25
ilyamore88
force-pushed
the
claude/clipboard-paste-research-2c2573
branch
from
October 10, 2026 12:26
3194244 to
a10f34f
Compare
ilyamore88
changed the base branch from
claude/undo-grouping-proposal
to
claude/undo-group-by-task-impl
October 10, 2026 12:26
ilyamore88
added this pull request to stack #204
October 10, 2026 12:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Planning only. This PR adds the
clipboard-paste-plain-and-editorjsOpenSpec change, the first slice of #137. It contains no code changes. It is stacked on #203, the implementation ofundo-group-by-task(proposed in #201). That change makes core record all changes of one browser task as one undo step.The change touches sdk, ui and clipboard-plugin:
PasteUIEvent(ui:paste), whichBlocksUIforwards from the nativepasteevent.ClipboardPluginprefersapplication/x-editor-jsand falls back totext/plain.importTextContent. Blank lines are skipped.ui:pastehandler, so core's per-task grouping records it as one undo step. The plugin uses no grouping API.preventDefaultwhen it can't handle the paste: no clipboard data, nothing usable, or a selection across several inputs. The existinginsertFromPastepath then runs unchanged.application/x-editor-jsis written only for whole-block or multi-block selections. A selection inside one block copies astext/plainandtext/htmlonly.Why
Paste currently goes through
beforeinput→insertFromPasteas plain text only. Multi-line text ends up in a single block, and the EditorJS payload written on copy is never read. Copy also has two problems that would break paste once the payload is read:BlockAlreadyExistsError.Notes for reviewers
pasteConfig, read-only mode, deleting a selection across blocks, cut, drop, and clipping partially selected blocks when copying.collaboration-managerregistered, a paste undoes in several steps. This comes fromundo-group-by-task's non-goal./opsx:apply clipboard-paste-plain-and-editorjsafterundo-group-by-task.