Skip to content

feat: inline comments#8901

Open
mejo- wants to merge 23 commits into
mainfrom
feat/comments
Open

feat: inline comments#8901
mejo- wants to merge 23 commits into
mainfrom
feat/comments

Conversation

@mejo-

@mejo- mejo- commented Jul 22, 2026

Copy link
Copy Markdown
Member

📝 Summary

This PR implement inline point-anchor comments as discussed in #185.

  • Comments can be inserted via toolbar submenu, by typing [?] or by pressing Ctrl-Alt-M
  • A superscript chat bubble icon (💬) marks the comment anchor in the text. Clicking it opens the comment bubble
  • Inside the comment bubble, one can add, edit and remove replies
  • Comments and footnotes can be hidden to improve legibility via "Hide annotations" in the toolbar submenu
  • Resolves: Inline comments #185

Markdown representation

Comments are stored using the footnote syntax already supported by Text, with a comment- prefix to distinguish them from regular footnotes:

The quick[^comment-1] brown fox.

[^comment-1]:
    - @[jane](mention://user/jane) *(2026-05-21T10:30Z)*
      Is "quick" the right word here?
    - @[bob](mention://user/bob) *(2026-05-21T12:45Z)*
      I think "fast" is more accurate.

Existing Markdown editors with footnote support (Obsidian, Ghostwriter) render the comment definitions as footnotes and make them accessible.

🖼️ Screenshots

Toolbar submenu Comment bubble Entering first comment reply Editing a reply
image image image image

🖼️ Screencast

Warning

Wait till the end, there's a long pause in between!

recording

🚧 TODO

  • Regression: Undo is now always disabled in toolbar
  • Would be great if adding/editing/deleting replies could be undoable as well edit: turns out it already is 🎉
  • Support to mention users in comments
  • Optionally replace NcRichContenteditable with a stripped-down Text editor for editing comments and replies

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@mejo-
mejo- requested a review from marcoambrosini July 22, 2026 15:43
@mejo- mejo- self-assigned this Jul 22, 2026
@mejo- mejo- added the enhancement New feature or request label Jul 22, 2026
@github-project-automation github-project-automation Bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Jul 22, 2026
@mejo- mejo- moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Productivity team Jul 22, 2026
@mejo-
mejo- force-pushed the feat/comments branch 2 times, most recently from e27b832 to 0ecbdff Compare July 23, 2026 07:41
mejo- added 18 commits July 23, 2026 09:56
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
Also use a fixed width to avoid visible container growth when opening
a comment bubble with long comments.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: OpenCode:claude-fable-5
* Use NcRichContenteditable as input field
* Use ProseMirror DOMSerializer to turn commentItem content into HTML
  and render it with Vue v-html.

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
mejo- added 5 commits July 23, 2026 09:57
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>
return result
})

const isFirstComment = computed(() => items.value.length === 0 || (items.value.length === 1 && !items.value[0].body))

@silverkszlo silverkszlo Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

The button only ever renders "Reply" and never "Comment", even when it's the first comment. Claude says, that isFirstComment compares serialized HTML ("<p></p>") and not real emptiness, so it's always false and therefore only shows "Reply".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

Inline comments

2 participants