Skip to content

feat(workspace): shared drafts through a DraftProvider - #6

Open
TimMikeladze wants to merge 1 commit into
mainfrom
feat/shared-drafts
Open

TimMikeladze wants to merge 1 commit into
mainfrom
feat/shared-drafts

Conversation

@TimMikeladze

@TimMikeladze TimMikeladze commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

A DraftProvider backs 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

  • drafts prop on <DevbarShell>, and shell: { modules: [...] } on the workspace routes to load a provider from a module. See "Shared drafts" in docs/WORKSPACE.md.
  • While a page is shared, the block editor writes on every keystroke. An empty block, half a slash command, or text about to split into two blocks goes out on blur.
  • The open block and caret are remapped when someone edits above them. Peers show beside the block they're in.
  • edit(next, base) sends the change from base, 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.setup hook.

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

  • Unit: 410 pass, in CI on ubuntu and macos.
  • Full e2e suite, run locally on this commit: 180 pass. CI doesn't run e2e.
  • The provider itself was tested from a separate private repo, with two browsers through this shell.

Not tested: a shared draft on the GitHub backend, over a non-local network, or with more than two typists.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
devbar Ready Ready Preview Nov 1, 2026 4:01am UTC

This branch was successfully deployed

1 active deployment
Preview — 00e64cd4 Deployed Nov 1, 2026 by vercel[bot]
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