Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments on block elements #6478

Open
max-nextcloud opened this issue Sep 30, 2024 · 1 comment
Open

Comments on block elements #6478

max-nextcloud opened this issue Sep 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@max-nextcloud
Copy link
Collaborator

max-nextcloud commented Sep 30, 2024

Summary

grafik
Initial sketch with available comments indicated in text and a button to create a new comment on the current active section.

Allow comments on block elements (paragraphs, headings, quotes, ...):

  • Allow create comments.
  • Display existing comments.
  • Allow removing ones own comments.

Motivation

Comments are useful in many situation. They allow adding information that directly relates to parts of the document without adding it directly to the document content.

Comments can be particularly helpful when drafting documents and during a review process.

Comments on block elements attach the comment to the relevant section on the document
while avoiding the complexity of in line comments such as overlapping comment ranges.

Specification

Comments can be added to all block elements:

  • Paragraphs
  • Headings
  • Quotes
  • Callouts
  • Code blocks
  • Images
  • Link Previews
  • Tables
  • all types of Lists

Alternatives

Inline comments

This draft mainly came out of the discussion of in line comments in #185.
In line comments allow commenting on a precise range of text, which is hard to represent in markdown.

Footnotes

While footnotes could also be used to represent comments, they serve a different purpose.
#2142 discusses footnotes.

User Interface Elements

  • Button to add a comment to a block element
  • Indicator that there are comments on an element
  • List of comments on an element
  • Button to remove ones own comment

Implementation

  • Comments will be serialized in markdown.
  • They will be implemented using the standard way in text:
    • Markdown-it extension parses them to html.
    • Tiptap nodes represent them in the editor.
    • toMarkdown function to serialize them.
  • Comments can contain multiple block nodes themselves.

Out of scope for now (but maybe future)

  • Edit my own comments.
  • Reply to other comments.
  • Suggest changes.
  • Integrate with nextcloud comments system.
  • Integrate with document chat (talk).
  • Notify about comments.
@max-nextcloud max-nextcloud added the enhancement New feature or request label Sep 30, 2024
@max-nextcloud max-nextcloud reopened this Sep 30, 2024
@nimishavijay
Copy link
Member

References

Google docs ![42a0cdf3-4d18-8022-8005-0c92e4168cf5](https://github.com/user-attachments/assets/e3a79d32-d214-48e1-853d-588d23105906)
Notion ![2d265c62-6e48-80b8-8005-0c92ddf5fe3b](https://github.com/user-attachments/assets/fcc991f0-cb75-4761-a45d-0b383a0ebd07)
Confluence ![2d265c62-6e48-80b8-8005-0c954d7669cb](https://github.com/user-attachments/assets/1ce3fb23-5ed3-4ff7-bd61-a2184213a7d6)

Design specs

Existing comments

image

  • Highlight the text (not the block, that looks too, well... blocky 😀) in color-primary-element-light at 0.5 opacity
    • Nice-to-have: a border-bottom: 2px solid var(--color-primary-element) also with 0.5 opacity
  • On hover: highlight opacity: 1
  • On click: highlight opacity: 1 and the comment opens

image

  • Comment box: max-width: 300px
  • Show avatar (34px), name, and comment with actions in a 3dot menu
    • nice-to-have: timestamp
  • Actions in the 3 dot menu: Delete if it's user's comment
    • nice-to-have: "Mark as resolved" if it is not user's comment

New comments

image

  • When the cursor is in a block or when you hover on a block, a comment button should appear (TBD: where and how it looks)
  • When you click on comment button:
    • text in block gets highlight (opacity 1)
    • New comment element opens

image

New comment element:

  • Show user's avatar (24px), name, input field, comment and cancel buttons
  • When you click on comment, the comment gets added and is shown as normal

Mobile view

Mockups TBD

  • Don't show the comment icon next to the block, instead show it on the top bar
  • Existing comments are stickied to right below the block they are associated to
  • Same for new comments, plus the keyboard opens

TBD:

  • Placement and exact of the comment button next to the block (left side? right side? secondary button? shadow?)
  • Placement of comment action in the top bar
  • Should there be a "Show/hide comments" toggle in the top bar?
  • Interaction of comments and author colors
  • How to show comments from different people:
    • do we need it for the MVP?
    • different colored highlight?
    • comment indication with avatar?
      image

What do you think? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants