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

Make private annotations/comments on a document feature #2149

Open
niiroobiro opened this issue Nov 6, 2024 · 0 comments
Open

Make private annotations/comments on a document feature #2149

niiroobiro opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
personalisation Relates to authenticated users Premium
Milestone

Comments

@niiroobiro
Copy link
Contributor

niiroobiro commented Nov 6, 2024

Find the write-up for this here:
https://docs.google.com/document/d/1CADWeX6xdeS_DkagKHZ5iZ6nsMpSLvCM9UVrfmuclnI/edit?usp=sharing

Make private annotations/comments on a document

Introduction:
This personalization feature enables users to add private annotations and comments directly to documents (judgments, legislation) within the platform. These annotations and comments will be visible only to the user who created them, ensuring confidentiality and a personalized study or research experience. Annotations will also be accessible through both the document view and a central list of annotated documents
Target Audience:

  • Legal researchers/journalists
  • Students
  • Candidate attorneys
  • Legal practitioners
  • Judges

User Need:

As a user, I want to be able to add private annotations to documents to enhance my understanding, analysis, and future reference. These annotations should be private and accessible, allowing me to personalize my experience and capture my thoughts without sharing them publicly.
As a user with multiple annotated documents, I want a clear, intuitive view of my documents with annotation details so that I can quickly understand my annotation activity

Proposed Solution:

  • When users hover over text in a document, Text changes color and an annotation icon appears in the right sidebar, allowing them to add private annotations/notes.
  • Documents are organized into folders
  • Each document displays an annotation-specific icon
  • A visible comment count appears next to each document and there is a clear visual indication of annotation presence and volume
  • Access and modify annotations in-document at any time like we already have in Google Docs where users can edit and delete annotations within the document and retain full context and original document integrity
  • Export /Download annotations as a document or other suitable format for offline reference.( With comments embedded)-This will be implemented at a later time
  • Users should be able to search for annotations.

Enhancements to Consider:
List View for Annotated Documents:
Provide users with a dedicated section in their profile to view all documents they have annotated. This list view will allow users to quickly find and navigate to their annotated documents, enhancing usability for frequent researchers.
Integration with Saved Documents:
Annotated documents should automatically appear in the user's "Saved Documents" section. This ensures that annotations are linked to saved documents for streamlined access and organization.
Helping a user realise they can add a comment
This can be done by showing a pop-up when a user hovers over a paragraph / portion of the document to let them know they can add private notes.

User Journey 1: Logged-In Users

  • The user browses the platform and identifies a document of interest.
  • When a user hovers over a section of text, Text changes color and a floating button appears on the right margin which follows the user as they scroll through the document with buttons to add an annotation and save the document.
  • Clicking the button opens a text box in the right margin to add an annotation and save it
  • The saved annotations will be displayed alongside the specific section of text where they were added.
  • The annotation text box should have buttons to edit and delete the annotation.
  • A button at the top of the document is available to hide all annotations.

Saved Documents

  • Annotated documents are saved in the user’s Saved Documents section, which is accessible from their profile.
  • Adding an annotation should automatically save the document if it wasn’t already saved.
  • Annotated documents are marked with an icon and a count of annotations is displayed..
  • If a user attempts to delete an annotated document from their saved documents folder, an alert will notify them that the document contains saved annotations, providing a chance to confirm or cancel the action.

User Journey 2: Not Logged-In Users

  • The user browses the platform and identifies a document of interest.
  • An anonymous user will see the menu bar with an option to add annotations
  • Clicking on it will prompt the user to log in/ sign up to use the feature.

Tech implementation

Backend

We have the option of using the django comments library which has some modelling and views that can handle comments. However, we need more flexibility for this issue. In particular, the modelling needs to have a html_tag field if we are to anchor the annotation at the correct position on the document. We also need customised views and forms that will be able to handle function with htmx. The library is primarily designed to to work with native django request and response, including template tags. Because of the nature of this feature, we may end up having to fight the library more than it helps us.
Therefore we can implement our own native Annotation model with the following fields

class Annotation:
  document - fk to Coredocument
  user - fk to User
  text - textfield for the actual annotation
  anchor - charfield, holds the id of the element from where the note should be anchored

Frontend

@niiroobiro niiroobiro added write-up Write-up required personalisation Relates to authenticated users Premium labels Nov 6, 2024
@niiroobiro niiroobiro self-assigned this Nov 6, 2024
@longhotsummer longhotsummer self-assigned this Nov 18, 2024
@longhotsummer longhotsummer added this to the 2025-Q1 milestone Jan 22, 2025
@actlikewill actlikewill removed the write-up Write-up required label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
personalisation Relates to authenticated users Premium
Projects
None yet
Development

No branches or pull requests

3 participants