githubnext/chopinPublic

Let's compose rich plans together

Add the comment thread protocol

Passage is the block run plus a range inside it, and the range is expressed
twice for the same reason an anchor is: relative positions so the highlight
stretches as somebody types inside the phrase, and a quote so it can be found
again after a move or an epoch rotation. The quote is a bounded locator and
length carries the real extent, so a passage longer than the bound is still
recoverable rather than refused.

Where a thread points travels on plan:anchors rather than in the comment
frames. A passage moves whenever the plan does, and that frame already exists
to carry every such relationship as one authoritative snapshot.

comment:start sends what the client can prove — block indices with the digests
it read them at — rather than positions it computed, so the server mints every
Yjs position from its own copy.
KCKrzysztof Cieslak authored
c5d03abPatch
Parentb9178b9
4 files changed+239-0
StackedSplit
apps/server/src/plan/service.ts+4 −0
packages/protocol/comment.d.ts+182 −0
packages/protocol/index.d.ts+3 −0
packages/protocol/plan.d.ts+50 −0