Structures · Transforms

SharedRichText

Transform formatting and text edits against one shared document.

Set the Eagle Creek problem first

Alice bolds the report heading while Bob appends the current trail symbol.

Each person carries a report page. When a person makes a change, they copy it onto a rich-text edit slip with the identity, path, sequence, or acceptance evidence that the rule needs. The demo shows both the local record and the note that travels.

An ordinary local edit names a position or value. That name can become stale while another client works. Watershed's rich_text_kernel uses this structure's rule to produce one shared result.

A SharedRichText applies this rule to the shared record.

Run the conflict

Alice and Bob act before either receives the other operation. Carol stays connected as the third replica and confirms the converged view.

Three Eagle Creek clients

SharedRichText authored race

Alice bolds the report heading while Bob appends the current trail symbol.

Watershed ruleRetain, insert, and delete deltas transform while preserving attributes.

Alice

Report page Hello World

Rich-text edit slip Bold Hello retain 5 · bold true

Bob

Report page Hello World

Rich-text edit slip Append marker retain 11 · insert ▲

Carol

Report page Hello World

Rich-text edit slip Observe the report No slip in this race

Shared view
  • Hello World

Enable JavaScript to run the race. The expected result remains in the lesson.

Ready: Hello World

Read the result

The heading keeps its formatting and Bob's insertion remains.

The demo models the authored race from Watershed's public structure examples. The lesson keeps the conflict rule visible before exposing its metadata or protocol.