Repository navigation
feat(workspace): shared drafts through a DraftProvider - #6
Open
TimMikeladze wants to merge 1 commit into
Open
TimMikeladze wants to merge 1 commit into
TimMikeladze wants to merge 1 commit into
Conversation
A provider backs a page's draft with text other people edit too, which is how the multiplayer service plugs in. Pass it as the `drafts` prop, or list a module in `shell.modules` that exports `drafts`. While a page is shared the block editor writes on every keystroke, remaps the open block and caret when peers edit above it, and shows who is in which block. `baseSha()` makes a draft started from an older file show a conflict. Plugins get a `setup` hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
A
DraftProviderbacks a page's draft with text other people edit too. This is the seam the multiplayer service plugs into. devbar gets no new dependency.What changes
draftsprop on<DevbarShell>, andshell: { modules: [...] }on the workspace routes to load a provider from a module. See "Shared drafts" indocs/WORKSPACE.md.edit(next, base)sends the change frombase, so an edit that hasn't rendered yet isn't undone.baseSha()is optional. A draft started from an older file shows a conflict on propose.DevbarPlugin.setuphook.With no provider, or when one returns null, a page stays on localStorage drafts. With no modules, the shell page's mount script is unchanged.
Testing
Not tested: a shared draft on the GitHub backend, over a non-local network, or with more than two typists.
🤖 Generated with Claude Code