However, I want the comments to 'stick' to the item (paragraph, sentence, image): if I move it to another place in the document, if I make text amends - even if I merge two paragraphs, the comment should remain visible. OK, the comment may not be relevant any more, but then I can 'archive' them with he previous draft (preserving a full history of comments plus text changes).
In my research I've found BitBucket's post [1] about how they built theirs, but it lacks detail. I imagine the technical challenges to be similar to Real-time Collaborative Editing [2] - keep track of text changes and re-apply comments to the right place.
So I appeal to the HN Community : Are there sample open source implementations out there? What terminology should I be searching for (finding the language of a new problem domain is challenging)? How would you implement it? Are there papers/web pages you can recommend? I believe Operational Transforms [3] are the way to go, but I have no basis for that.
1. http://blog.bitbucket.org/2012/10/30/building-inline-comments-for-pull-requests-and-commits/ 2. http://en.wikipedia.org/wiki/Collaborative_real-time_editor 3. http://en.wikipedia.org/wiki/Operational_transformation