Page MenuHomePhabricator

Comments extension should highlight the author's comments on blogs and the like
Open, Needs TriagePublic

Description

Highlight user's comments in blogs, so that it would be easier to distinguish between comments. However, the comments on an article ( if at all it is enabled) should not be highlighted.

Event Timeline

Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald Transcript
MaroonPixel subscribed.

This would be a good starting task for Pre-university students to start with. I'd love to mentor the students who wish to take this project up.

aswinshenoy renamed this task from Comments extension should highlight the author's comments on blogs and the like to Highlighting User's Comments.Nov 4 2018, 9:55 AM
aswinshenoy removed aswinshenoy as the assignee of this task.
aswinshenoy updated the task description. (Show Details)
aswinshenoy subscribed.
Aklapper renamed this task from Highlighting User's Comments to Comments extension should highlight the author's comments on blogs and the like.Nov 4 2018, 4:03 PM

Can I work on this issue?

No need to ask, just start coding! :)

Hi everyone I just set up the initial environment for MediaWiki and installed the Comments extension in C:/xampp/htdocs/mediawiki/extensions. I updated the LocalSettings.php file, but when I use the <comments/> tag, it only shows "Loading comments" with a stuck loading symbol. How can I troubleshoot this? I'd really like to work on this

Hi everyone I just set up the initial environment for MediaWiki and installed the Comments extension in C:/xampp/htdocs/mediawiki/extensions. I updated the LocalSettings.php file, but when I use the <comments/> tag, it only shows "Loading comments" with a stuck loading symbol. How can I troubleshoot this? I'd really like to work on this

Instead of Phabricator, which is the place for bug reports and feature requests, these kind of tech support/"how do I...?" questions are better asked on:

But to answer your precise question: the behavior you're seeing is presumably happening due to the API call to the commentlist API module failing in the initialize method in /extensions/Comments/resources/js/Comment.js. The parser hook handler (which takes care of rending the <comments /> tag) in /extensions/Comments/includes/parser/DisplayComments.php adds a div which has both the class and id set to comments-body. The JS code looks for that ID, and if and when it finds it, it calls the initialize function, which fetches relevant data from the API (for which the PHP backend is in /extensions/Comments/includes/api/CommentListAPI.php).

You may wish to see what happens when you ping that API end point manually, e.g. from your browser's developer tools console (press F12 on Firefox to launch it; its "Network" view is pretty handy for viewing requests and seeing if some requests are failing and with what error code, etc.).

Thanks a lot got it to work now

Change #1200406 had a related patch set uploaded (by AROHI_SINGH; author: AROHI_SINGH):

[mediawiki/extensions/Comments@master] Add highlighting for blog author comments

https://gerrit.wikimedia.org/r/1200406

Change #1309754 had a related patch set uploaded (by Pushpaktiwari; author: Pushpaktiwari):

[mediawiki/extensions/Comments@master] Highlight author's comments in blogs

https://gerrit.wikimedia.org/r/1309754

I've submitted a new patch for this task for review.

The implementation highlights comments made by the original page author on configured namespaces (default: Blog namespace) using RevisionLookup with lazy loading and caching. It also adds proper i18n support for the author badge and addresses the concerns raised in the previous review by avoiding category-based detection.

Gerrit: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Comments/+/1309754