Page MenuHomePhabricator

Reply inserted at the wrong indentation level when the previous message ends in a bullet list
Closed, ResolvedPublic

Description

Reply is inserted at the wrong indentation level when the previous message ends in a bullet list.

Consider these two examples:

== 1 ==
Comment
* with list ~~~~

== 2 ==
Comment
* with list
and PS ~~~~

They are both comments with no indentation. When you reply to them, the new comments should have indentation of 1, like this:

== 1 ==
Comment
* with list ~~~~
:Expected indentation ~~~~

== 2 ==
Comment
* with list
and PS ~~~~
:Expected indentation ~~~~

But the actual result in case 1 is this:

== 1 ==
Comment
* with list ~~~~
** Actual indentation ~~~~

Event Timeline

A question related to the observation @Whatamidoing-WMF made above: @matmarex can you confirm whether this is still an issue?

It appears that in both cases – ==1== and ==2== – comments are being indented at the correct level of indentation (read: they are being indented "once"): https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User_talk%3APpelberg-test%2Fsandbox&type=revision&diff=441225&oldid=441223.

Indeed, it looks like this case was accidentally fixed in rEDTO569db3603c10: Improve detecting template-generated multi-line comments. I used git bisect and ran the tests on each commit to find out.

However, when a similar comment is itself a reply instead of top-level, it still behaves incorrectly:

== 3 ==
Lead comment ~~~~
:Comment
:* with list ~~~~

When replying to the second comment in this example, the expected result is:

== 3 ==
Lead comment ~~~~
:Comment
:* with list ~~~~
::Expected indentation ~~~~

But you actually get:

== 3 ==
Lead comment ~~~~
:Comment
:* with list ~~~~
:**Actual indentation ~~~~

Change 617292 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Add a test case for replies to top-level comments with mixed indentation

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

Indeed, it looks like this case was accidentally fixed in rEDTO569db3603c10: Improve detecting template-generated multi-line comments. I used git bisect and ran the tests on each commit to find out.

However, when a similar comment is itself a reply instead of top-level, it still behaves incorrectly:

Understood. [i]

To confirm: does https://gerrit.wikimedia.org/r/617292 correct the behavior you described in T252702#6347165 and produce the expected result (also described in T252702#6347165)?

== 3 ==
Lead comment ~~~~
:Comment
:* with list ~~~~
::Expected indentation ~~~~

i. https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User_talk%3APpelberg-test%2Fsandbox&type=revision&diff=441807&oldid=441806

No, it only adds a test case for examples 1 and 2, so that we don't accidentally un-fix them. I'm working on also fixing example 3.

No, it only adds a test case for examples 1 and 2, so that we don't accidentally un-fix them. I'm working on also fixing example 3.

Roger that.

Change 617292 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Add a test case for replies to top-level comments with mixed indentation

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

Change 618400 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Fix indentation level when replying to comments with mixed indentation

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

Change 618400 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Fix indentation level when replying to comments with mixed indentation

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

matmarex added a project: Skipped QA.

(no manual QA required, because this is covered by unit tests)