Spectrum: Improvements to replied messages

Created on 27 Apr 2018  路  15Comments  路  Source: withspectrum/spectrum

This is a followup to #2924

  • [x] When replying to long messages, we should truncate the reply in the chat input preview and in the reply bubble itself.
  • [ ] Clicking on a reply should scroll the chat to that particular message. If the original message has not been loaded due to pagination, we should handle paginating until the original message loads
  • [x] When pressing the "Reply" button, the quoted message should only be shown in the chat input in the selected thread, not everywhere else too
    screen shot 2018-05-02 at 12 43 36

  • [ ] Bonus: If a user highlights text of a bubble then clicks reply, it should only reply to that selected text

Feature

Most helpful comment

I think an ideal UX here could be the same as email clients: if there is highlighted text on the message when the quote reply button is clicked, it automatically uses the highlighted text as the snippet.

All 15 comments

@mxstbr @brianlovin i would like to take bonus feature if it is not done yet

That'd be awesome @dev-drprasad :D

@brianlovin what is meaning of bubble ?

We call the individual chat messages "bubbles" :)

@brianlovin do we need any backend support for bonus feature or just frontend work ??

It will require backend work - I haven't thought too much about how this should work, but in theory if you're highlighting a snippet of a message we need to know what the snippet is; our current system only stores a parentId which fetches the entire parent message.

So I think we'd also need to store the snippet, and make sure we don't render it if the parent message was deleted.

@brianlovin looks like little bit more work. i guess i need some more to finish.

@brianlovin @mxstbr
what do think about design for quoting selected text ??
do we need to add one more action like quote selection in actions list beside bubble ??
or tooltip action like in image
download

like medium?馃榾

I think an ideal UX here could be the same as email clients: if there is highlighted text on the message when the quote reply button is clicked, it automatically uses the highlighted text as the snippet.

@brianlovin where is code resided to handle dispatched actions ? i mean making api calls
i worked with only saga before. so, i am little confused :(

Work? Nah. ?

@dev-drprasad check src/actions for our action dispatchers, then we have src/reducers directory with the store reducers

window.getSelection() method will return selected text in complete document. so we cant blindly use window.getSelection() to get selected text because it can be anywhere in document

we can use window.getSelection().baseNode.parentNode.closest('div.message') to get message wrapper. but how can we decide this message wrapper related with reply action element ??

I am thinking of adding data-message-id attribute to message wrapper and use react refs to get message id. so that we can use it to check whether reply action is associated or not with message

@mxstbr @brianlovin what do you say ??

We knocked out the core experience here for replying to threads.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carloslfu picture carloslfu  路  3Comments

brianlovin picture brianlovin  路  5Comments

flaki picture flaki  路  5Comments

dmitryyankowski picture dmitryyankowski  路  4Comments

entrptaher picture entrptaher  路  3Comments