Add the ability to make a side note on public documents #8813
Unanswered
foufa3010
asked this question in
Self Hosting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
overview:
To implement the ability to add a side note or comment on public documents, where each comment includes information about the author and the timestamp.
Database Changes:
Add a new field to the collections table:
Field: commenting
Type: nullable boolean
true = comments enabled for the collection
false = comments disabled for the collection
null = default behavior (based on workspace settings).
UI Changes and Proposed Solution
1.Document View:
- For each public document, show an option to view and add comments if the commenting feature is enabled.
- Display a comment icon or link next to the document title.
- When clicked, show all comments with the author name and timestamp next to the document content.
2.Comment Display:
- Each comment will display:
- Comment text
- Author (name of the user who made the comment)
- Timestamp (when the comment was created)
3.Add Comment Button:
- An input field for adding comments.
- Submit button to add the comment.
logic:
`function onComment(Document, auth) {
const team = auth.Team;
// If the document has an explicit commenting setting, use that
if (Document.commenting !== null) {
return Document.commenting;
}
// Otherwise, fall back to the team preference for commenting
return team.getPreference('Commenting');
}
`
Benefits:
Additional Considerations
UI Changes and Proposed Solution
Document Page: Display a comment section under the document content if commenting is enabled.
Comment Button: Provide an easy-to-use UI for adding comments with an input field and submit button.
Comment List: Display all existing comments with the author and timestamp.
Additional Considerations
Permission Management: Ensure that only authorized users can post comments (e.g., verified users or team members).
Comment Moderation: Implement a feature to moderate or delete comments if inappropriate content is posted.
Performance: If documents or comments become large, implement pagination or infinite scrolling for fetching comments.
Security: Prevent XSS attacks by sanitizing the comment input before saving it to the database.
Beta Was this translation helpful? Give feedback.
All reactions