How to get answer's comments? (stackoverflow-like & tiny)

By default, discourses answers and replies to answers are organized chronologically

  • [QUESTION]
  • Answer #1 (Monday)
  • Answer #2 (Tuesday, early)
  • 1st reply to answer #2 (Tuesday, late)
  • 2nd reply to answer #2 (Wednesday, early)
  • 1st reply to answer #1 (Wednesday, late)
  • 2nd reply to answer #1 (Friday)
  • 3nd reply to answer #2 (Saturday)

We know that Discourse does records the child-relation of replies to a parent answer, because as admin we can select an answer and its children :

enter image description here

I now want that each reply to an answer appears on my discourse, as for Stackoverflow/Stackexchange’s “comment vs answer”, below the answer it comments. Such as :

  • [QUESTION]
  • Answer #1 (Monday)
    • 1st reply to answer #1 (Wednesday)
    • 2nd reply to answer #1 (Friday)
  • Answer #2 (Tuesday)
    • 1st reply to answer #2 (Tuesday)
    • 2nd reply to answer #2 (Wednesday)
    • 3nd reply to answer #2 (Saturday)

Q: Is there a plugins or solution to have discrete, nested comments as for stack-exchanges sites ?


Related to: Thoughts on a plugin which turns discourse into stackoverflow

5 Likes

Discourse was designed for flat discussion. While we do store the reply_to_postnumber info, you’re going to have a really bad time if you want to do threading with Discourse.

2 Likes

If reply_to_postnumber is added the the post such as

<div class="topic-post clearfix regular" data-reply_to_postnumber="107" style="min-height: 1018px">
...
</div>

Then, some JS + CSS could do the sorting.

Is that first part so hard ?

Nope. The JS part is the hardest.

1 Like

For the reasons :
Discourse has a lot of sugar and settings that the competition doesn’t really have, or not as clean.
StackOverflow is great but doesn’t provide its soft, or too expensively (>=$175k).

For the dev :
Sorting out the posts via JS seems easy, but side effects happen on the right side chrono-elevator.
(I’am first thinking about a dirty client-side JS solution)
The “Reply” form, also, suggest a flat system.

The thing that’ll really screw you up when trying to do nested comments is that a single post can be a reply to multiple earlier posts. How you nest that (tuck the reply under the “first” replied-to post? the “biggest” reply? duplicate it under all the posts it replies to?) is something you’ll need to decide.

6 Likes

Clarification : only one more level wanted
I want to have a single level of comments, put below an answer. Really like stackoverflow. No need for deep depth nor deep tree nesting. The basic idea is that we often don’t want long chit-chat, but just send a discrete note and request for clarification, so the answer can be clarified where it is (author come back and improve his answer) rather than go into a pingpong discussions.

As for Stackoverflow, I would consider we either react-reply-answer to the topic’s question via an answer, or we react-reply-comment to an answer via a comment on it. I’am aware this is not the out of the box way of discourse, but I would like to have this possibility available.

Reply to multiple earlier post ?
I have difficulties to understand your “reply to multiple earlier posts” tho. You mean a reply (post=“6”) to a reply (post=“5”) to a reply (post=“3”)
 produce that post 5 actually reply_to_postnumber="4, 3, 2" ??

* Question (post=2)
** reply (post="3" reply_to_postnumber="2") 
*** reply (post="4" reply_to_postnumber="3") 
**** reply (post="5" reply_to_postnumber="4")

and would be a challenge ?

Possible approach.es
I think I could approach that like Stackoverflow, and helped by some clean CSS, make post=“3” an answer to post=“2”, and post=“4” and post=“5” both comments of post=“3”, very much like Stackoverflow.

But rather that this hack of current structure, it could be easier to have a plugin which ADD a new comment array of objects, attached/attachable to an answer. For the visual design, these comments being tiny in font-size, limited in number of characters, compact by design.

1 Like

No. reply_to_post_number will always link to 1 post (when you clicked on the Reply button underneath a post).
But, you can quote any number of posts, thus replying to multiple posts.

Oh. I forgot about this “quote” functionality. lol. As usual, easy at first, then you get yourself into a long run. :joy:

The answer to your question is that yes this is possible to do this in a plugin, but this plugin doesn’t exist yet. Discourse core will probably not adopt this functionality (but I don’t speak for them) as Discourse is designed for discussions, not QA topics. Nevertheless, Discourse has a great plugin system.

If you’re interested in building this plugin yourself, I can help you figure this out. If not, post a paid job on the marketplace and there are a number of good developers who could take it (I don’t take paid gigs).

6 Likes

I think this is the crux of the issue. If you want something Stack Overflow-like, then there are plenty of open source SO clones out there (some of them eerily similar) that you can use. Trying to shoehorn Q&A into Discourse is unlikely to end with a satisfying result for anyone.

4 Likes

I looked for opensource SO-like, often one man made project, not as many functionalities, no active development.
Lot of noise.
Also, Discourse is interesting, the civic approach is interesting. We are looking for a mix. But i’am open to SO-like suggestions.

2 Likes

Indeed, I would like to testify that the need for this to be possible is shared.
I am glad to learn that it is technically possible through plugin development. @angus
I’m still looking for ways to implement this reply behavior through the forum.

In the intervening years since this topic was last active, such a plugin has been created :slight_smile:

7 Likes

oh wow this is what i was looking for 5 years ago since i started using and growing a community with Discourse

Angus’s plugin is now discontinued in favor of the official Discourse Post plugin:

1 Like