zed icon indicating copy to clipboard operation
zed copied to clipboard

Add the ability to reply to a message

Open RemcoSmitsDev opened this issue 1 year ago • 2 comments

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 deleted or 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.

Screenshot 2024-01-31 at 22 06 30 Screenshot 2024-01-31 at 22 06 48 Screenshot 2024-02-01 at 22 56 25

Release Notes:

  • Added the ability to reply to a message.

RemcoSmitsDev avatar Jan 31 '24 21:01 RemcoSmitsDev

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:
  1. Check if the message is cached locally, otherwise fetch the single message from the server
  2. Fetch replied messages when they getting placed inside the view
  3. 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:
    1. Client sends RemoveMessageRequest to the server
    2. Server removes the message from the database and figures out what other messages are referencing the deleted message
    3. Server broadcast RemoveMessageResponse (including the removed message id and the messages to update which originally replied to the deleted message)
    4. 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?

bennetbo avatar Feb 03 '24 23:02 bennetbo

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.

ConradIrwin avatar Feb 04 '24 16:02 ConradIrwin

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.

JosephTLyons avatar Feb 06 '24 22:02 JosephTLyons

You should be able to click the "x" in the top right of the reply preview?

Screenshot 2024-02-06 at 9 30 41 PM

ConradIrwin avatar Feb 07 '24 04:02 ConradIrwin

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.

It might be a nice feature to also be able to close the preview by using the esc key.

RemcoSmitsDev avatar Feb 07 '24 09:02 RemcoSmitsDev

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.

See #7517

bennetbo avatar Feb 07 '24 20:02 bennetbo