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

Quotes + Reply to message update #2757

Merged
merged 60 commits into from
Jun 23, 2023
Merged

Conversation

yougotwill
Copy link
Collaborator

@yougotwill yougotwill commented May 16, 2023

This PR updates both the logic and UI for replying to messages and rendering quotes in a conversation.

This PR replaces #2399

Closes #2343

Fixes: #2625

  • If the original message cannot be found then the quoted author's name along with the text "Original message not found" is shown in all cases including if there was previously an attachment.
  • For replying to messages and for quotes the quoted author should be on the first line, followed by a single line of quoted content (truncated with an ellipsis).
  • Updated linkify-it dependency to 4.0.1
  • Removed duplicate getMessageBySenderAndTimestamp() and replaced any calls with getMessageBySenderAndSentAt()
  • For backwards compatibility purposes between platforms we now send the full text body of a message as part of the quote object when sending a quote and not a limited version of it. This means we removed QUOTED_TEXT_MAX_LENGTH and sliceQuoteText().
  • When we load messages in the UI we now check for any quotes and do a separate database lookup for these quoted messages in bulk. These are then stored in a separate lookup map in redux. This creates a notable performance improvement for loading quotes since we are not loading quotes via individual database calls.
  • Extracted individual <Quote /> elements into separate components.
  • Converted message quote styles to Styled Components and removed sass stylesheet.
  • Removed reference warning component since it is no longer used
  • Improved labeling of an attachment's MIME type for both replying to a message and rendering a quote
  • Consolidated quote message and reply to message design to match mobile platforms.
  • Fixed rendering of of text that has been emojified
  • When clicking on a quote a highlight animation is shown on the original / quoted message. Originally this only worked for text based quotes. This now supports all message types.
  • Quoted image attachments now load correctly on first render.
  • Added .vscode to eslint and prettier ignore files.
  • Replaced hard-coded "Unknown" ui strings with window.i18n('unknown').

@yougotwill yougotwill changed the title WIP: Quotes update Quotes + Reply to message update May 16, 2023
ts/hooks/useParamSelector.ts Outdated Show resolved Hide resolved
ts/node/sql.ts Show resolved Hide resolved
ts/state/selectors/conversations.ts Outdated Show resolved Hide resolved
ts/state/ducks/conversations.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@Bilb Bilb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

added localisation for attachment description
updated StyledStagedPlaceholderAttachment to be a styled functional component
…imestamp

which does the same thing but is more verbose
resolved regression with quote author name
… object

this should help performance when loading quotes in the UI since individual db lookups will no longer be required
forEach and async still don't play nice so used a regular for loop, added QuoteLookupType
removed reference warning component since it is no longer needed
show message not found in correct context
remove border on quote if there is an attachment
converted quote primary text to styled components
added support for generic file icon with consistent design. Still need to support know file types and metdata from the generic file component
make sure to load message text is it exists for all quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending only an image as a reply to a quoted message loses the quoted message.
3 participants