Page MenuHomePhabricator

Reply inserted at wrong indentation level on ja.wp (after a comment with an empty paragraph)
Closed, ResolvedPublic

Description

Reply was inserted at wrong indentation level on ja.wp (after a comment with an empty paragraph) in this edit: https://ja.wikipedia.org/w/index.php?diff=79496531

It looks like the reply tool treats the empty paragraph after the previous comment as a part of the second comment, and because of that it treats the second comment as if it was not indented.

Reported here: https://www.mediawiki.org/wiki/Topic:Vu8wzo47w82h3grl


For example, on this page/revision, in the last section:
https://ja.wikipedia.org/w/index.php?title=Wikipedia‐ノート:記事名の付け方&oldid=79273071

  • First reply button should open the reply widget with 1 indent at the bottom – currently it opens in the middle
  • Second reply button should open the reply widget with 2 indents – currently it opens with 1 indent (same as previous comment)

Event Timeline

Change 630937 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Ignore empty paragraphs at the beginning of comments

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

Change 630937 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Ignore empty paragraphs at the beginning of comments

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

The second example given in https://www.mediawiki.org/wiki/Topic:Vu8wzo47w82h3grl was a horizontal like (---- in wikitext, <hr> in HTML). It's not an empty paragraph, so it also gets treated as part of the comment, and also causes invalid indentation. My patch above doesn't fix this case.

Thinking about this further, there seem to be other things that separate comments but are not part of them – such as the {{outdent}} and {{clear}} templates (and their versions on other wikis).

So I think I'd like to do this differently after all.

Change 631298 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Ignore other empty-ish things at the beginning of comments

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

Change 631299 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Ignore outdent templates at the beginning of comments

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

Change 631298 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Ignore other empty-ish things at the beginning of comments

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

JTannerWMF removed a project: Editing QA.
JTannerWMF added subscribers: Ryasmeen, JTannerWMF.

@matmarex please add testing instructions then move it back to @Ryasmeen column

Change 649443 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Change which nodes are ignored at the beginning of comments again

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

It seems I'm still not sure myself how exactly this should work…

Change 649443 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Change which nodes are ignored at the beginning of comments again

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

Change 631299 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Ignore outdent templates at the beginning of comments

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

Test pages:

Replying to any comment should behave exactly the same on both pages. Previously, the various separators (present on the first page) would cause the reply tool to insert replies in the wrong places or on the wrong indentation levels. Now they should be completely ignored.

Checked the indentation levels of different comments that includes different kinds of separators on the original page mentioned in the task description and also checked the test pages provided. Comments are now getting indented correctly.