feat: inline comments - #8901
Conversation
0ecbdff to
8eda11e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The plugin post-processes data from footnotes plugin. As we cannot change the label parsing rules of the footnotes plugin, this seemed to be the most sensible thing to do. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-opus-4-8
The comments container is hidden in UI for now. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Makes sure the input field is focussed when the comment bubble opens. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>
The command is registered in an own Tiptap extenstion that requires a browser. In the comment node unit tests, we don't have this extension loaded. Signed-off-by: Jonas <jonas@freesources.org>
Good catch. I fixed this by switching to
Another good catch. Fixed by setting a
Indeed, that's inconsistent. I changed this now that deleting is only possible after adding a guest name as well for consistent UX. I also did the following:
|
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Avoids the bubble growing until viewport top and overlapping with viewer header and close button. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
There was a problem hiding this comment.
Very cool! Some first feedback:
- Showing/hiding annotations changes the text flow a little bit, which makes things look unstable/brittle. That might be because the comment emoji is aligned a bit to the top? It’s fine if it’s vertically centered, it would be more important for the text not to move vertically. :)
- The comment field is quite large / high, which makes it a bit massive and imposing. It would be ok to reduce it to the height of 3.5 lines of text, or even a single line if we use autosize.
- The "Edit comment" and "Delete comment" actions can go into a 3-dot action menu. Then they can have proper text and are not so in-your-face.
- A quick animation moving the comment field down when sending the comment would be nice. Better than an interface jump
- Right now it is only possible to show a single comment thread, right? Other solutions make it possible to view all comments at the same time, which is especially useful if there are multiple and not really many replies going on.
I would like to keep this for a follow-up, as I have to say I find it quite confusing how others display all the comments per default and I think we should think this through properly. All other comments addressed @jancborchardt |
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
This is not technically necessary but creates a more consistent user experience, as all editing actions are only available after setting a name now. Signed-off-by: Jonas <jonas@freesources.org>
Use a NodeView in commentReference to allow adding a click handler. Use a button element instead of link in there to make the reference accessible via tab navigation. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Allows to insert a comment with a straight-forward keyboard flow: 1. Insert comment via Ctrl-Alt-M 2. Type comment and submit via Ctrl-Enter 3. Close bubble via Esc 4. Continue typing in document Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Also ensures guest name is reactive everywhere, regardless of whether it got set via comment bubble or guest name dialog. Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org> Assisted-by: OpenCode:claude-fable-5
Signed-off-by: Jonas <jonas@freesources.org>

📝 Summary
This PR implement inline point-anchor comments as discussed in #185.
[?]or by pressing Ctrl-Alt-MMarkdown representation
Comments are stored using the footnote syntax already supported by Text, with a comment- prefix to distinguish them from regular footnotes:
Existing Markdown editors with footnote support (Obsidian, Ghostwriter) render the comment definitions as footnotes and make them accessible.
🖼️ Screenshots
🖼️ Screencast
🚧 TODO
Regression: Undo is now always disabled in toolbarWould be great if adding/editing/deleting replies could be undoable as welledit: turns out it already is 🎉🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)🤖 AI (if applicable)