Page MenuHomePhabricator

[Task] Edit Summary handling on the client, part 3
Closed, ResolvedPublic

Description

from T101836#1414639:

On the client, ChangeHandler currently ignores the (currently empty) comment field from the incoming EntityChange. When creating a RecentChanges entry, ChangeHandler sets rc_comment to the empty string. RecentChanges stores the fields and metadata from the EntityChange in the 'wikibase-repo-change' RC attribute, which is handled by ExternaLRecentChange. However, the 'comment' and 'composite-comment' fields are overwritten with the output of getEditComment() first. This is later picked up and processed by ExternalChangeFactory and ChangeLineFormatter. This should be changed so that ChangeHandler generates and stores human readable summaries in rc_comment, while preserving the original edit summary somewhere in the RC params:

  1. ExternalRecentChange::buildAttributes() should pass $attribs['comment'] to rc_comment (if set).
  2. ChangeHandler::getRCAttributes() should return 'wikibase-repo-change' => array_merge( $fields, $rcinfo ) with $fields and $rcinfo unchanged. $rcinfo['comment'] and $rcinfo['composite-comment'] should not be set.
  3. ChangeHandler::getRCAttributes() should separately return a value for the 'comment' attribute, constructed by calling getEditComment( $change ); if there are multiple coalesced changes in $fields['info']['changes'], getEditComment( $change ) is called fro each of them, and the results combined using Language::semicolonList. If the result is too long (>250 char or so), add "... and N more changes" to the end.
  4. ChangeHandler::getRCAttributes() should drop the "instanceof ItemChange" conditional.
  5. ChangeHandler::getEditComment() should always return a string, a human readable edit summary in the wiki's conent language. If the change is a sitelink change, the summary is generated by SiteLinkCommentCreator. Otherwise, it is generated by AutoCommentFormatter (which needs extra functionality to find and replace the autocomment block). Side note: investigate whether ExternalRecentChange really has to serialize everything into rc_params.
NOTE: the plans above assume that it's ok (for now) to have edit summaries in the client wiki's content language. For multilingual wikis, this isn't very nice, but it's consistent with other edit summaries there.

Event Timeline

daniel raised the priority of this task from to High.
daniel updated the task description. (Show Details)
daniel added subscribers: MGChecker, Ricordisamoa, aude and 3 others.
Lydia_Pintscher renamed this task from Edit Summary handling con the client, part 3 to [Task] Edit Summary handling on the client, part 3.Sep 4 2015, 1:49 PM
Lydia_Pintscher set Security to None.

picking this up, as discussed during the daily sprint meeting

Change 236051 had a related patch set uploaded (by Daniel Kinzler):
Expand auto-comments in ChangeHandler

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

Change 236051 merged by jenkins-bot:
Pass repo comments through ChangeHandler

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

hoo added a subscriber: hoo.

This seems to be done now (except for the small bit about to long comments. I've created T114149 for that).

Change 239835 had a related patch set uploaded (by Daniel Kinzler):
Pre-format comments in ChangeHandler

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

Change 238137 had a related patch set uploaded (by Daniel Kinzler):
Replace ExternalRecentChange with RecentChangeFactory.

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

Change 239835 merged by jenkins-bot:
Pre-format comments in ChangeHandler

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

Change 238137 merged by jenkins-bot:
Replace ExternalRecentChange with RecentChangeFactory.

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