Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planning issue: merging Answers into Comments #4094

Closed
jywarren opened this issue Dec 2, 2018 · 21 comments · Fixed by #8471
Closed

Planning issue: merging Answers into Comments #4094

jywarren opened this issue Dec 2, 2018 · 21 comments · Fixed by #8471

Comments

@jywarren
Copy link
Member

jywarren commented Dec 2, 2018

There is a long list of issues with Answers and Comments, not only because they're easy to confuse (#884) but also because having both requires double maintenance and lots of duplicated code (#3535, #4034, we'd need to develop a moderation system for answers in addition to questions, etc etc).

Let's make a few changes to the system, and consider merging the two types. We would have to:

  1. make it possible to comment in response to another comment (perhaps using the comment.aid field to refer to a comment.cid it's in response to, instead of the answer.aid it's in response to)
  2. convert all Answers into Comments, preserving timestamps, and changing all attached comments to the new Comment record, in a big database migration
  3. display comments that respond to other comments in the threaded way that Answers are currently shown
  4. make a "reply" button on comments that inserts the cid into the form so that the response goes to that comment, OR build in a commenting form to each comment... ?
  5. migrate answer_selection (i.e. likes on answers) to the differently-plumbed comment likes (which is actually a nicer system with emoji and such)
  6. figure out how the question.answers features will work, because answers can be "accepted" -- perhaps this also becomes part of the comment liking system, with a "checkbox" emoji?
  7. ensure statistics for Answers (http://publiclab.org/stats) are preserved somehow or merged into comments?

This is a big, complex project. But the outcome is that the codebase would be MUCH simpler and less redundant. There wouldn't be two different mixed types of responses to a post (comments + answers), but just one. We'd no longer have to have systems for turning comments into answers, and discussions wouldn't get fragmented across the two systems, as in https://publiclab.org/questions/warren/02-21-2018/what-do-you-think-about-this-new-design-sketch-for-a-welcome-page

This is a large project that will take careful work! Most of it may have to happen in the same pull request!

We could conceivably make the comment-in-reply-to-comment system first, test it, then begin merging the old Answers into that system, to do this in 2 parts. But no matter what, it'll take some hard focused work to achieve and not lose any content.

@jywarren jywarren changed the title Planning issue: merging Answers and Comments Planning issue: merging Answers into Comments Dec 2, 2018
@jywarren jywarren added this to the Long term project planning milestone Dec 2, 2018
@ViditChitkara
Copy link
Member

Starting with this!!

@ViditChitkara
Copy link
Member

For the first point, could we have a commentable_type which could be "Comment", "Answer" or "Standalone" or something. This way we'll be able to distinguish between "comment on" an answer or a comment or a simple standalone comment. How does this sound @jywarren.

@jywarren
Copy link
Member Author

jywarren commented Jan 2, 2019 via email

@ViditChitkara
Copy link
Member

Sounds well, will do it.

@skilfullycurled
Copy link
Contributor

Hey everyone,

Wanted to circle back on this because in working on the stats page, I remembered that this topic has been under discussion.

Regarding the "how to mark something as answered" issue, I think the best idea is number 6, using a check mark. I can't recall how the previous incarnation worked but I think instead of having a binary state of "answered" it would be better to have a count of answers. This way, people don't have to re-post a question if the answer they found doesn't work for them.

A few other thoughts to bring to the discussion:

  1. It seems to me one of the issues we'll inevitably run up against with these changes is how to let people know how the system works. It's utility really does depend on understanding things like, , and even Those familiar with this Stack Overflowish way of working need to understand how ours differs ("How do I mark a question as answered?", "Can I mark more than one question as answered?"), and for those who are not familiar, they need to understand how it works in the first place (that a question can even be marked as answered).

    Right now, I think this is begin addressed by different colored UI warnings (I think that's what they're called in bootstrap) which is making the UI a bit crowded. Perhaps in the next iteration we could move to a model which gives a list of things you can do with two buttons which say "Read More" and "Got it!" The former of which opens up a page in a new tab giving a deeper explanation.

    Alternatively we can change the text in the yellow warning above to include more options, for example:

    "Was a comment helpful? Give it a thumbs up! Did it answer your question? Mark it with a green check! Don't forget to come back and report your progress especially if you found a different answer!"

  2. I think we should revisit the current yellow warning bar which says:

    Person A is asking a question on Topic X. Subscribe to answer questions on this topic.

    I think the intention was to say that if you know a lot about this topic and want to be notified about future questions you can answer, then subscribe." My interpretation is "Person A is asking a question about Topic X, in order to answer questions on this topic, you need to subscribe to it". No ideas for alternatives yet but I'll think on it.

  3. May I hear a bit about the intention behind the "Is this a question?" feature.

@jywarren
Copy link
Member Author

jywarren commented Jun 5, 2019

Hi @ViditChitkara -- noticing there's a lot of now-unnecessary answer code in comment.rb -- https://github.com/publiclab/plots2/blame/master/app/models/comment.rb#L223 -- is this part of our plan to clean up as well? Thank you!

@skilfullycurled thanks, sorry i want to circle back to this too, but getting at some of the refactoring first --

@jywarren
Copy link
Member Author

jywarren commented Jun 5, 2019

And @ViditChitkara forgive me, i am almost certain i am missing a comment you made on this recently. But wanted to link what @skilfullycurled asked about "checkmark response" meaning "answer" and wonder if on this PR we might not be better off changing the question.answers code to, instead of fetching Answer records, to just fetch comments with such a checkmark response, in a new version of def answers in node.rb?

https://github.com/publiclab/plots2/pull/5495/files

@jywarren
Copy link
Member Author

jywarren commented Jun 6, 2019

Yes, here's the checkmarks issue!!!

#5261 (comment)

@jywarren jywarren reopened this Jun 6, 2019
@ViditChitkara
Copy link
Member

Hi @ViditChitkara -- noticing there's a lot of now-unnecessary answer code in comment.rb -- https://github.com/publiclab/plots2/blame/master/app/models/comment.rb#L223 -- is this part of our plan to clean up as well?

Sure, I'm refactoring this as well. I think removing this will involve a lot of tests failing so will need to refactor them as well. So yes, this is a part of our code clean up. Great!! This is very exciting.

Also, applologies for the late reply, was out of station for a few days.😅😅

@jywarren
Copy link
Member Author

Circling back here, sorry for delay!

I think we should revisit the current yellow warning bar which says:

Person A is asking a question on Topic X. Subscribe to answer questions on this topic.

I think the intention was to say that if you know a lot about this topic and want to be notified about future questions you can answer, then subscribe." My interpretation is "Person A is asking a question about Topic X, in order to answer questions on this topic, you need to subscribe to it". No ideas for alternatives yet but I'll think on it.

I'd love some new ideas on where to make these prompts. Maybe we can think in terms of the new Style Guide. Some pages have real issues with info overload and competing for attention, like the tag pages. The Style guide may be a good place to address this as those changes will all be implemented this summer, I hope! We can check with @CleverFool77 and @gautamig54 on this as well. And the wording ... gosh, yes, it's not super clear! Thanks @skilfullycurled !!

May I hear a bit about the intention behind the "Is this a question?" feature.

For sure. This also could be refined. The idea is that people often ask questions in a comment, but then the discussion around it is then buried in commments and not present on our topical Q&A tables. So it's looking to encourage people to "promote" their comment to a question. However, it was a quick fix; ideally perhaps we'd want to be able to copy the sub-comments over too, and then have a message like "This comment was converted to a Question, click here" or something like that... so comments don't get bifurcated... but as you can see this gets complex fast. So. Perhaps this (and the above) could become new issues to brainstorm UI and wording?

Thanks, this is great stuff @skilfullycurled -- sometimes we balance "low maintenance quick fixes" with our caution about overly complex solutions that'll be brittle or require maintenance... but sometimes it's a quick fix also just becomes permanent, unfortunately. Very glad for your brain on this!

@skilfullycurled
Copy link
Contributor

You've really captured the reasoning behind my ideas @jywarren, which is the tension between letting people know all of the exciting things they can do on the site/how a specific feature works and information overload. And, I totally understand the quandary of development resources/priorities vs. implementing the ideal version of a feature.

Here are a few possibilities of varying complexity for Q&A instructions:

  1. Simply change the yellow alert text to more of an introduction and include the link to the questions help page.
  2. Use an introductory modal where the features are explained along with a link to the questions help page and a "Got it" button to dismiss the modal and add a cookie to prevent it from displaying each time (example sans cookie))
  3. How/where ever the introductory text goes, we could add a button that says "Take a tour!" which initiates a tour of the features using a library such as bootstraptour or intro.js.

As for the "is this a question" feature, that's what I assumed. Perhaps this feature was removed since merging changes but I'm not seeing the blue alerts anymore. In any case, we might do something like the following where we either put a link at the bottom or add a button and a tool tip. Aside: I have moved the "reply" link but that's just a aesthetic proposal. I don't know how complex it would be to change the comment template. You can also just add it to the area where the "reply" link is currently. I also think we can remove "...to this comment" (another FTO?).

Screen Shot 2019-06-12 at 12 40 29 PM

Finally, some ideas for the yellow alert subscription text.

  1. This is a question about X. Subscribe to this topic to receive more questions like it!
  2. Subscribe to this topic, X, to receive more questions like it!
  3. Interested in questions about X? Subscribe to receive more questions like it!
  4. Learn or help us answer more questions about X by subscribing to receive more questions on this topic!

@jywarren
Copy link
Member Author

jywarren commented Jun 12, 2019 via email

@ViditChitkara
Copy link
Member

Simply change the yellow alert text to more of an introduction and include the link to the questions help page.
Use an introductory modal where the features are explained along with a link to the questions help page and a "Got it" button to dismiss the modal and add a cookie to prevent it from displaying each time (example sans cookie))
How/where ever the introductory text goes, we could add a button that says "Take a tour!" which initiates a tour of the features using a library such as bootstraptour or intro.js.

This modal and tour seems to be a good idea to me. A separate style guide may sometimes be confusing to remember. I think a step by step tour would be much easier to grasp. What do you think @skilfullycurled @jywarren

@ViditChitkara
Copy link
Member

Yeah a separate issue would be great!! I'd like to help on this!! Seems like an interesting discussion.

@skilfullycurled
Copy link
Contributor

Great, thanks for the feedback everyone!

I'll create something about UI changes (?) and maybe we can add a discussion tag and then split them up further.

@ViditChitkara, I agree that would be ideal. I think both are pretty easy to implement programmatically, it's just that the tour will take more time to design the steps.

Okay.

See you soon in a new issue!

@skilfullycurled
Copy link
Contributor

FYI: not forgetting about making a new issue, just need to take care of some other things and sometimes Github can be a real rabbit hole for me! : )

@jywarren
Copy link
Member Author

Noting that there is still some grey vs. green checkboxes display on the site, like on https://publiclab.org/wiki/water-quality#Questions+on+Water+Quality:

image

This is still being driven from old "answers" code, which we should deprecate!

<% if node.has_accepted_answers %>
<i class="fa fa-check-square" style="color:#0c8;"></i>
<% else %>
<i class="fa fa-check-square" style="color:#808080;"></i>
<% end %>

plots2/app/models/node.rb

Lines 244 to 250 in ee8200e

def answered
answers&.length&.positive?
end
def has_accepted_answers
answers.where(accepted: true).count.positive?
end

@Tlazypanda
Copy link
Collaborator

@jywarren Is this checkbox thing still available...would love to take this up but need some context on this first ...can you help me out? Thanks :)

@jywarren
Copy link
Member Author

Hm, i think we resolved this? Can you check in an existing questions grid, say, on a page linked to from https://publiclab.org/methods ? Thank you!

@ebarry
Copy link
Member

ebarry commented May 7, 2020

Just popping in to say I still see gray and green checkboxes on https://publiclab.org/wiki/water-quality#Questions+on+Water+Quality

@jywarren
Copy link
Member Author

jywarren commented Oct 6, 2020

OK, dealing with checkboxes! And, noting we have to remove a ton of old Answers code here:

https://github.com/publiclab/plots2/search?q=answer

Finally, i believe the migration of old answers to comments has preserved the stats. However, this display will have to be modified to count comments, rather than answers:

Screen Shot 2020-10-06 at 7 06 37 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants