docs/solutions/best-practices/editor-behavior-specs-must-lock-node-model-and-affinity-before-ux.md
It is easy to spec the visible behavior first:
But if the spec never locks the actual node model, the UX law is built on sand. That is exactly how a footnote reference can be described like an atom while still behaving like editable inline text.
isVoid or affinity
contract.contentEditable={false} in the DOM as equivalent to a void node.Make the spec stack declare two things up front for every current feature:
Use explicit model classes:
block non-voidblock void atominline non-void spaninline void atomleaf marktext tokenoverlay / no nodeUse explicit affinity classes:
directionalhardoutwardnone / n-aThen define UX chrome on top of that model instead of the other way around.
The model decides what the editor is even allowed to do:
Once that is explicit, selection, hover, jump, and toolbar rules get much less hand-wavy.