Add the ability to reply to a message
Feature
- [x] Allow to click on reply to go to the real message
- [x] In chat
- [x] Show only a part of the message that you reply to
- [x] In chat
- [x] In reply preview
- [ ] Send notification when someone replies to your message
TODO’s
- [x] Fix migration
- [x] timestamp(in filename)
- [x] remove the reference to the reply_message_id
- [x] Fix markdown cache for reply message
- [x] Fix spacing when first message is a reply to you and you want to reply to that message.
- [ ] Fetch message that you replied to
- [ ] allow fetching messages that are not inside the current view
- [x] When message is deleted, we should show a text like
message deletedor something - [x] Show correct GitHub username + icon after
Replied to: - [x] Show correct message(now it's hard-coded)
- [x] Add icon to reply + add the onClick logic
- [x] Show message that you want to reply to
- [x] Allow to click away the message that you want to reply to
- [x] Fix hard-coded GitHub user + icon after
Reply tp: - [ ] Add tests
Note: The reply (text, GitHub user) is hard-coded, so it may look a bit confusing.
Release Notes:
- Added the ability to reply to a message.
While working on this today, we thought about some questions that we need to answer before we can continue.
Questions
- How should we handle the max lines of text for the preview of the reply message?
- How should we handle fetching referenced (replied to) messages from the server? Some ideas we thought about:
- Check if the message is cached locally, otherwise fetch the single message from the server
- Fetch replied messages when they getting placed inside the view
- Including the replied to message body and user information inside the message itself (what about edited/deleted messages?)
- Workflow for approach 3. when deleting message:
- Client sends RemoveMessageRequest to the server
- Server removes the message from the database and figures out what other messages are referencing the deleted message
- Server broadcast RemoveMessageResponse (including the removed message id and the messages to update which originally replied to the deleted message)
- Client removes the deleted message from the view and updates the messages that were referencing the deleted message
We would love to hear your thoughts on these questions @ConradIrwin. We are also down to pair if you'd like, maybe on Monday?
Happy to pair! You can book time here: https://calendly.com/conradirwin/pairing or catch me online at some point.
For the preview size I’d pick another chat (maybe Twitch or Discord) and copy what they do.
For fetching messages I like the idea of the client fetching the ones it doesn’t have - in the common case it won’t need to but if there’s a big gap between the original and reply it will. That way there should be no need to handle edits/deletes differently as the client has the id of the message being replied to it can update the view to match.
One thing I noticed, I'm not sure how to dismiss the reply action if I decide I dont want to do a reply after all. I think esc should dismiss it, or something similar.
You should be able to click the "x" in the top right of the reply preview?
One thing I noticed, I'm not sure how to dismiss the reply action if I decide I dont want to do a reply after all. I think
escshould dismiss it, or something similar.
It might be a nice feature to also be able to close the preview by using the esc key.
One thing I noticed, I'm not sure how to dismiss the reply action if I decide I dont want to do a reply after all. I think
escshould dismiss it, or something similar.
See #7517