question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Reply To Comments

See original GitHub issue

First of all, thank you so much for building and open sourcing use-comments. I love how simple it is to setup!

I would love a way to add replies to a particular comment. If someone asks a question, then we can publicly answer them or say thanks maybe.

Happy to make a PR myself if you can guide me a bit & help me get started.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
beerosecommented, Apr 27, 2021

Hi @gupta-ji6,

I’m sorry for the late reply. I’m currently working on a hosted version of this project in which I plan to implement reply to comments functionality. The project itself should be released in 2-3 weeks, and the reply functionality in another 2-3 weeks.

As for this project, I definitely won’t have time to work on it right now, so the contributions are most welcome! I’ve been thinking about this functionality while building it for the first time, and here what I’ve wanted to do:

  • Add new column to the comments table: parentComment or parentId.
  • Create a foreign key relation: comments.parentId -> comments.id. A comment could have multiple comments that point to it.
  • That said, a comment which is a reply to another one, would point to the “parent” comment.

Example: Take this GitHub issue as an example. If your comment is the “main comment”, and my response is a “reply to a comment”, then the information would be stored somewhat this way:

id: 1
author: @gupta-ji6
content: ...
...
parentId: null

---

id: 2
author: @beerose 
content: ...
...
parentId: 1

Hope it makes some sense 😅

Let me know if you have more questions!

1reaction
beerosecommented, Dec 11, 2021

@SaadBazaz @gupta-ji6 thank you!

I guess there are a few things to do:

  1. Decide on the API (more below) and DB structure.
  2. Update the hook implementation.
  3. Update the metadata in this repo (should reflect new db structure).
  4. Update the docs.

As for 1., there are multiple options and questions:

  1. How should we send a reply? Should it be a part of addComment function, with, for example, additional replyTo field, or should it be an additional method: addReply?
  2. How should users fetch the replies? Should they be fetched automatically for the comment? Or should we allow pagination? Or maybe there should be an includeReplies option and fetchReplies(parentCommentId)?

Could you describe what would be the best API for you?

As for the DB, I suggest adding a new column called parent_id or reply_to, and then when fetching “base” comment we would exclude the ones with parent_id being filled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Tips for Responding Graciously to Customer Feature ...
10 Tips for Responding Graciously to Customer Feature Requests · 1. Be open and honest · 2. Be grateful for their effort ·...
Read more >
Feature request response email templates
Feature requests are messages that customers send to inquire about a feature that is not included in your product or service.
Read more >
10 Tips to Improve Your Feature Request Responses
Feature requests are the best way to improve your product. Here are ten tips to make the most out of them.
Read more >
What Is a Feature Request? Definition and Examples
A feature request is a comment, message, or ask from a user to implement a specific feature into your product. Feature requests can...
Read more >
Feature Request Template: How to Collect User Feedback ...
Customer support team – Can ask users to fill out the feature request template if their concerns are related to adding new product...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found