Page MenuHomePhabricator

Investigate where to put replies to comments inside a box/div/table
Closed, ResolvedPublic

Description

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?

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