User:Ganeshaditya1/$PROGRAM

GSoC: Prototyping inline comments

 * Public URL: https://www.mediawiki.org/w/index.php?title=User:Ganeshaditya1/$PROGRAM
 * Bugzilla report link: (Bug 46440) https://bugzilla.wikimedia.org/show_bug.cgi?id=46440

Name and contact information
https://www.mediawiki.org/wiki/User:Ganeshaditya1

Name: AV Aditya Sastry

Email:ganeshaditya1@gmail.com

IRC or IM networks/handle(s): AdityaSastry

Location:Vishakhapatanam, Andhra Pradesh

Typical working hours: 2:00 PM to 12:30AM

Synopsis
Every MediaWiki article has a talk page. But the discussions here are very generic in nature and are concerned with the whole article rather than a part of it.

With Inline commenting, user could select a line of an article and write a comment for it, which could be viewed by other users and they can respond to the comment as well. This greatly helps engage the readers as well the editors in discussions about the articles and thus help make them better and accurate.

One of the main reasons why I choose the visual editor sub category was because prior to getting acquainted with MediaWiki, Wikipedia was entirely an enigma to me. I was largely a consumer of information but was never able to contribute back. This was because the interface back then was pretty complicated for me, with wiki text and stuff. With things like talk pages and stuff, it is generally very tough to engage readers especially the non-tech savvy readers. An inline commenting extension would greatly appeal to there intuition of how community would collaborate to make articles better IMO.

Project summary
My idea is to have a single special page which would be displayed as a tab right next to edit button if possible. This page would receive the article name and will use it to extract the article from the database and then render it and display it like an ordinary wiki article. Now when someone wants to leave a comment for a line, he would select the line and press a specific key. Then we would record his selection.

As pointed out by James Forester to me in the Bugzilla page of this project, Rangy is the ideal choice for capturing the text selection as it supports firefox and ie equally. With rangy I would get the DOM containers starting and ending DOM nodes  where the selection happened as well as the offsets in these DOM containers. These four parameters along with the article name will be saved in a database.

These four parameters will be used to reconstruct the location where the selection happened.

An important task here is to serialize the DOM node to be able to save in a database. I chose to represent the DOM tree node as XPath string. This conversion from DOM node to xpath and back to DOM node is implemented in JavaScript. I derived the idea for this from the OFKN project's annotator tool.

Deliverables
1) Special page to view comments as well as make them

2) Database classes.

3) Sanitizer classes needed to sanitize the comments posted.

4) AJAX, JQuery and any necessary JS functions to implement this functionality.

About you
I have been using Wikipedia since my 10th class. I owe my life to Wikipedia cause anything I have accomplished academically its owing to Wikipedia. I have only contributed to my university's Wikipage once. But mostly I have been a consumer.

How ever I feel ashamed in confessing that until I started working on MediaWiki I didn't know about the talk page and even when I came to know about it, I noticed that the talk pages of few articles that I frequently read are congested with discussions about the whole article rather than a sub part of it that I am concerned with. Hence I had to read the whole discussion to comprehend the context to be able to contribute to these discussions. I am sure other Wikipedia readers might have felt the same about it to.

Participation
I am a workaholic. I can't focus on anything else when I have some work pending. So I will be spending all my free time on this project and it is my first priority.

I will be communicating my progress on weekly basis and I plan on putting my extension in a github and I would be committing to it regularly on daily basis so that my mentor could track my progress.

Till the end of this month I wouldn't be available on IRC as am changing my ISP(My current ISP strangely blocks IRC, SSH, FTP and it is because of him that my bugfixes were so horrible initially). However I am still accessible on email, gmail, facebook and on phone if deemed necessary. Once I finish switching my ISP I will be available in Freenode.

Past open source experience
I have fixed three bugs in MediaWiki. Here's my github account https://github.com/ganeshaditya1. Here I am posting the gerrit links as they are shorter than the bug links in buzilla, these three have been merged, the insert http links is not working.


 * 1) https://gerrit.wikimedia.org/r/#/c/59822/


 * 1) https://gerrit.wikimedia.org/r/#/c/59395/ (This was my first bugfix to an opensource project and my first time with git and I had a pathetically slow (3kbps 2G internet connection), so I made a lot of mistakes and I admit occasionally loosing my cool too.


 * 1) https://gerrit.wikimedia.org/r/#/c/59393/

Bug fix stuck in a limbo:
https://gerrit.wikimedia.org/r/#/c/59390/ I submitted a fix to this but it was decided by chad that the bug is not necessary to fix. so it was abandoned.

Any other info
I have first prepared this mockup:

http://adityasastry.in.cp-2.webhostbox.net/index.php?title=Special:BlankPage

With both the views for viewing the comments as well submitting the comments implemented as movable popup's (Movable part is not yet implemented)

Then I saw that the postings in the bugzilla bug page and noticed that people are looking for something that looks like CO-ment. So I came up with this mockup:

http://adityasastry.in.cp-2.webhostbox.net/index.php?title=Special:Inline#

In this the comments are displayed in-line with the article. Instead of being displayed in the margin. I wouldn't mind putting it in the margin but as it was already pointed out margin space is way too small and the comments would look congested.

I personally prefer my first mockup as it doesn't effect the original wikipedia UI and doesn't harm the readability however I am open to suggestions and I keep an open mind when it comes to UI Design.