Page MenuHomePhabricator

Investigate where to put replies to comments inside a box/div/table
Open, Needs TriagePublic

Description

This task is about making it so comments posted with the Reply Tool do not appear within templates/tables published by way of Barnstars/Wikilove.

This task contains two cases:

  • Case 1
  • Case 2

Case 1 was resolved, we think, in June 2020.

Case 2 is not yet resolved.


Cases

Case 1 (June, 2020)

The "right" location for a reply has traditionally been determined through human judgment. See https://hu.wikipedia.org/w/index.php?title=Szerkesztővita:Pasztilla&curid=258186&diff=22453105&oldid=22452319 on @Pasztilla's talk page:

The reply ended up inside the box (table), but it belongs outside. However, some editors use tables, div elements, etc., to create a decorative border or background color around the entire page, and in that case, comments belong inside the box. What should we do?

Case 2 (November, 2020)
Comment posted with the Reply Tool appears within Barnstar at fa.wiki. See: https://w.wiki/mjB .


Behavior

  1. Navigate to a discussion page where someone has left a Barnstar. E.g. https://en.wikipedia.org/wiki/User_talk:PPelberg_(WMF)/sandbox?dtenable=1#Testing_phab:_T250126
  2. Click the [ reply ] link that is appended to the barnstar. In this case, it's the The Tireless Contributor Barnstar.
  3. Notice the Reply Tool opens
  4. Write a comment
  5. Publish the comment you drafted in "Step 4"
  6. Notice the comment you published in "Step 5" appears beneath the Barnstar you replied to in "Step 1" [i]

i.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 14 2020, 12:57 AM
matmarex claimed this task.Apr 28 2020, 8:39 PM
matmarex added a subscriber: matmarex.

The reply ended up inside the box (table), but it belongs outside. However, some editors use tables, div elements, etc., to create a decorative border or background color around the entire page, and in that case, comments belong inside the box. What should we do?

It occurred to me that we can distinguish these two cases by checking whether the box contains anything else other than a single comment, and if it doesn't, we can assume that the box itself is actually a part of that comment, and add replies outside of it.

I wrote some prototype code and this approach seems to work, I'll need to test it a bit more though.

Change 593059 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] [WIP] Insert replies outside of decorative comment frames

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

The reply ended up inside the box (table), but it belongs outside. However, some editors use tables, div elements, etc., to create a decorative border or background color around the entire page, and in that case, comments belong inside the box. What should we do?

It occurred to me that we can distinguish these two cases by checking whether the box contains anything else other than a single comment, and if it doesn't, we can assume that the box itself is actually a part of that comment, and add replies outside of it.

I wrote some prototype code and this approach seems to work, I'll need to test it a bit more though.

What if the user has a full page decorative div inside which replies should go, but they've just archived all but one comment in a conversation?

What if the user has a full page decorative div inside which replies should go, but they've just archived all but one comment in a conversation?

As long as there is a heading above that comment, the reply will go inside the frame. If there isn't a heading and the comment is really literally the only thing on the page, it will go outside the frame, but I think that would be a very rare occurrence.

…At least, it should go outside the frame, but actually, Parsoid doesn't add the closing </div>/|} to the wikitext, so it goes inside the frame after all (but it's outside in our preview). I reported this as T252464.

Change 593059 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Insert replies outside of decorative comment frames

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

In case of the originally reported comment, the Reply link is still appearing inside the box. Is that expected after the fix? If not, please update the task with expected behavior. Also mention other pages where you want this to be QAed on, if you feel that's necessary.

The reply link should appear in the box. The task is to move where the reply itself goes, see below. Sorry if the title was not clear.

The reply link should appear in the box. The task is to move where the reply itself goes, see below. Sorry if the title was not clear.

Ah, sorry, I misunderstood the description! Makes sense now. Closing it.

ppelberg closed this task as Resolved.Jun 5 2020, 1:30 AM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 5 2020, 1:30 AM
ppelberg reopened this task as Open.EditedTue, Nov 17, 2:11 AM
ppelberg added a subscriber: ppelberg.

Re-opening this task per https://www.mediawiki.org/wiki/Topic:Vxsjw65l1o0o2o6s.

Two notes:

  1. I've added the details from the thread linked above to the task description.
  2. I was able to produce the expected behavior here: https://en.wikipedia.org/w/index.php?title=User_talk:PPelberg_(WMF)/sandbox&type=revision&diff=989107778&oldid=989107693&diffmode=source

I can't reproduce the problem on the linked fa.wp page https://fa.wikipedia.org/w/index.php?title=بحث_کاربر:Ladsgroup&direction=next&oldid=30374114:

The reply interface appears as expected outside the barnstar table:

And my actual reply was also posted outside the table: https://fa.wikipedia.org/w/index.php?title=بحث_کاربر:Ladsgroup&diff=30389339&oldid=30384506&diffmode=source (although it looks like there were other comments in the latest revision, so this might not actually be a meaningful test)

ppelberg added a comment.EditedThu, Nov 19, 8:27 PM

I can't reproduce the problem on the linked fa.wp page https://fa.wikipedia.org/w/index.php?title=بحث_کاربر:Ladsgroup&direction=next&oldid=30374114:

The reply interface appears as expected outside the barnstar table:

I'm noticing this behavior to be inconsistent.

In some cases, I see the Reply Tool interface appear beneath the Barnstar as expected [i] and in other cases within the Barnstar which is unexpected. [ii]

@matmarex, do you know what might be causing this inconsistent behavior? One thought: perhaps in the second case [ii] this bit of styling syntax [iii] is affecting things?

Note: in both cases, the comments are published beneath the Barnstar as expected.


i.

| source
ii.
| source
iii. <span style="text-shadow:#396 0.2em 0.2em 0.5em; class=texhtml">

I've now ran into this on my own talk page and looked into it again. I think this regression has the same root cause as T267988, and should be fixed by the patch there.

The issue occurs like this:

  • The fix for this task works by checking if a comment contains exactly the contents of a decorative frame, and if so, adding replies outside of it
  • The bug T267988 caused comments to appear to also contain a part of the preceding heading, so that check did not work

It seems that the incorrect behavior would only occur if the barnstar (or a similar decorative frame) was the only thing in its section (no other replies), and if the section edit links were shown (they don't appear when viewing an old revision), I think this explains the inconsistencies Peter and I saw.

Should be already fixed on the Beta Cluster, and should be fixed in production with next week's deployment (1.36.0-wmf.20).

(I guess we should move this to the current workboard?)