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

Closed
max-nextcloud opened this issue Sep 30, 2024 · 3 comments
Closed

Comments on block elements #6478

max-nextcloud opened this issue Sep 30, 2024 · 3 comments
Assignees
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 mentioned this issue Sep 30, 2024
2 tasks
@max-nextcloud max-nextcloud reopened this Sep 30, 2024
@nimishavijay
Copy link
Member

nimishavijay commented Oct 1, 2024

References

Google docs

42a0cdf3-4d18-8022-8005-0c92e4168cf5

Notion

2d265c62-6e48-80b8-8005-0c92ddf5fe3b

Confluence

2d265c62-6e48-80b8-8005-0c954d7669cb

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? :)

@jancborchardt
Copy link
Member

Looks super neat @nimishavijay! :) I think the comment indicator with avatar is very nice – also because even though the line is highlighted, if that’s the only indicator it’s not really clear it’s because of a comment. It could also just be formatting (of course not possible via Markdown but people don’t know that. :)

@juliusknorr
Copy link
Member

Moved to #185

@github-project-automation github-project-automation bot moved this from 📐 At design to 🎉 Done in 🖍 Design team Nov 13, 2024
@github-project-automation github-project-automation bot moved this from 🧭 Planning evaluation (don't pick) to ☑️ Done in 📝 Office team Nov 13, 2024
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
Status: ☑️ Done
Status: 🎉 Done
Development

No branches or pull requests

4 participants