Automattic / Automattic/cortext
Sync Cortext pages
- Dominant language
- JavaScript
- Stars
- 51
- Forks
- 2
- Avg merge
- 3h 12m
- Merged PRs (30d)
- 8
Description
## Depends on
* #162 (shim fix)
* #164 (spike)
## Goal
Two people editing the same page see each other's block changes within a few seconds, with no save clobbering the other.
## Scope (locks in after the spike)
* Turn the engine on at the server level: `WP_ALLOW_COLLABORATION` define plus the `wp_collaboration_enabled` site option (admin: Settings, then Writing).
* When the server gates pass, core injects `window._wpCollaborationEnabled` via `wp_collaboration_inject_setting()`. Don't set that global ourselves. If the spike shows the injector doesn't run on Cortext's custom shell, hook into the injection point so the global lands the same way it would on a normal admin screen.
* Register `_crdt_document` meta on `crtxt_page` if the spike says it isn't auto-attached.
* Confirm `rest_base: 'crtxt_pages'` doesn't break addressing on `POST /wp-sync/v1/updates`.
## Acceptance
* Two browsers on the same page see each other's edits, no overwrites.
* After both stop, canonical `post_content` reflects the merged result.
* Revisions still get created on save.
* Playwright multi-context test covers the case.
## Context
First surface for WP 7.0 sync engine adoption. The block-editor CPT is the smallest surface and should get the auto-applied post-type sync config for free.
---
*This issue is the result of a guided back and forth between Opus 4.7 and GPT 5.5.*
Contributor guide
Research direction
Resolve dependencies #162 and #164 first, then inspect the server-level collaboration gates, wp_collaboration_inject_setting(), crtxt_page metadata, and POST /wp-sync/v1/updates addressing. Run or add the Playwright multi-context test for two browsers editing one page. Done means edits merge without overwrites, canonical post_content is merged, and revisions are still created on save.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, playwright
- Domain
- api, backend, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100