Skip to content

Draft: feat/contextual comments

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

Please Note: The functionality for the comments extension used in this MR is almost entirely copied from this project, since it was a single page extension i didn't think I needed to install a new package and add to the long list of dependencies, the license on the repo allows for the code to be copied, but I would just like to acknowledge that owner of the repo deserves full credit for his extension

What does this MR do and why?

This MR adds the contextual comments feature to wiki pages as discussed in &14062, !149472 and #465371.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot from 2024-07-07 22-18-18.png Screencast from 07-07-2024 18:07:37.webm
Screenshot from 2024-07-07 22-18-52.png
Screenshot from 2024-07-07 22-19-08.png
Screenshot from 2024-07-07 22-19-18.png
Screenshot from 2024-07-07 22-19-26.png

How to set up and validate locally

  1. Clone and setup the nodejs API currently being used for the comments demo, by following the instructions here
  2. Clone the branch related to this MR.
  3. Navigate to the wiki of any demo repo and you should be able to add and delete comments.

To add contextual comments

  1. Select some of the wiki content and a comment icon should be rendered above the text
  2. click on said icon and a comment form should be rendered
  3. after adding a comment and clicking on "comment" a new comment will be added to the comment section below and the selected text will be highlighted like this
  4. You can then go to the comment below and click the "see context" text and the page will span to the relevant context, its highlight will be slightly darkened, and its text underlined.
Edited by Salihu Dickson

Merge request reports