Discussion - comments on Notebooks and everywhere else
Is your feature request related to a problem?
A feature request that has already come up internally is comments on Notebooks a la Google docs etc.
This is one of those "iceberg" features that is simple on the face of it but has endless potential for scope and complexity creep so I wanted to outline what we could do to determine if it is worth the effort.
Describe the solution you'd like
- Comment on Notebooks It would be great if I can add a comment to any line of the document, including a "widget" that would somehow be indicated in the UI, opening the right hand side panel to show the comments when clicked
- Mentions - Possibly underpinning this is the idea of mentions so that you can @mention someone and have a way for that person to be aware of all places they've been mentioned
- Replies The next feature that would immediately be requested is replies - this would mean that any "comment" can get a follow up reply to make a thread like system
- Notifications - Comments are only really useful if I would be made aware of them - this would be either via an @mention in the comment, or if it is my Notebook
- We already have the activity panel - a somewhat okay solution would be to have some representation there for me to see all the comments I would be interested in
- TRICKY - longer term people would want notifications which of course gets more complicated...
- Comments anywhere - why keep this constrained to Notebooks? Could I attach comments to a feature flag? To an Insight? Massive scope creep...
It feels like it would make a lot of sense to keep comments separate from Notebooks themselves.
comment:
- user: User
timestamp: Date
message: String
notebook: String # ID of the notebook or "resource" to make it generic
notebookIdentifier: String # Could be a nodeId or a line number
deleted: boolean
Remaining work
- [ ] Display linkable comments in activity (made hard due to the way the thing is designed...)
- [ ] Only allow commenting on a single line / don't allow broken up marks if possible
- [ ] Mentions in comments (do we need tiptap for this? 🙈 )
- [ ] Mentions in notebooks (i.e. - if a new mention is added, eventually add an activity log entry)
Agreed on all the thinking here. Some additional thoughts as I read through:
Inline comments
It's likely, possibly most likely, that people will want to leave comments on the inline text. Text won't have id's like our own nodes do. I'd imagine inline comments would be implemented as a mark (similar to bold or italic) that then references a comment object (as indicated above). That would make it super easy to reference / render the comment from the document but not as easy to do it the other way around. In the activity feed for example, rendering the text part of the document the comment relates to would be difficult. Perhaps we could store a preview:string on the comment model to solve for those cases.
Rich text editing
How meta do we want to go? While possible I don't think anyone has a need for nesting all the nodes we currently support in a comment but it might be nice to give people somewhat of a rich text experience. Bold / Italics and the likes are probably pretty easy to do in the same way GitHub supports them if we use the existing LemonMarkdown component, but we'd probably need a variation of our TipTap editor if we are to support things like mentions. Would certainly be a reason to descope that from a first version in my opinion.