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

Fixed UI Inconsistencies while quoting messages #605

Merged
merged 16 commits into from
Oct 1, 2024

Conversation

devanshkansagra
Copy link
Contributor

@devanshkansagra devanshkansagra commented Jul 9, 2024

Acceptance Criteria fulfillment

  • Added support for quoting different types of attachements
  • Implemented displaying of attachement while quoting
  • Fix recursive quoting
  • Fix design of quoted message in curved variants

Fixes #563

Video/Screenshots

Screencast.from.2024-07-14.16-41-33.webm

@Spiral-Memory
Copy link
Collaborator

Hey @devanshkansagra,

Thanks for the contribution.

While quoting messages, there's a sideline that appears and quotes the message. It seems like you simply removed it, which shouldn't be the case. Please also try it in Storybook so that we can see the changes across all design variants. It must work properly in all variants. Additionally, I don't think it's a good idea to show thumbnails in "QuoteBox." Images look fine, but video and audio appear way too big.

@devanshkansagra
Copy link
Contributor Author

Okay will check that

@devanshkansagra
Copy link
Contributor Author

image

@devanshkansagra
Copy link
Contributor Author

devanshkansagra commented Jul 11, 2024

Hey maintainers, I have fixed the issue of recursive quoting, but I got stucked at styling of recursive quoting of messages in curved variants, I have explored a lot, but I didn't get any clue. So anyone could please suggest me, what kind of design improvements I need to make to fix this

This is the design issue in curved variant

image

It looks proper in other variants (Ex StormySeas)

image

@Spiral-Memory
Copy link
Collaborator

Hey @devanshkansagra It looks good !

Let me know the exact problem you are facing in fixing the design in curved variant as well

@Spiral-Memory
Copy link
Collaborator

Also please update the video with your latest changes

@devanshkansagra
Copy link
Contributor Author

devanshkansagra commented Jul 11, 2024

Hey @devanshkansagra It looks good !

Let me know the exact problem you are facing in fixing the design in curved variant as well

Most basically the improper alignment in curved variants

@devanshkansagra
Copy link
Contributor Author

Also please update the video with your latest changes

Updated the video

@Spiral-Memory
Copy link
Collaborator

Also please update the video with your latest changes

Updated the video

Checked your video, Great work!

Can we fix this as well before fixing for the curved variant, that it should display the actual message here instead of msg link:

image

Also, in recursive quoting, the video / image is not visible, I know you have let me know about it that even with main RC it doesn't work, but it would be great if you find a fix for that as well if possible.

Thanks!

@devanshkansagra
Copy link
Contributor Author

Also please update the video with your latest changes

Updated the video

Checked your video, Great work!

Can we fix this as well before fixing for the curved variant, that it should display the actual message here instead of msg link:

image

Also, in recursive quoting, the video / image is not visible, I know you have let me know about it that even with main RC it doesn't work, but it would be great if you find a fix for that as well if possible.

Thanks!

will fix and make the recursive quote preview look like RC

@devanshkansagra
Copy link
Contributor Author

devanshkansagra commented Jul 12, 2024

image

@devanshkansagra devanshkansagra marked this pull request as ready for review July 13, 2024 12:37
@devanshkansagra devanshkansagra changed the title Fixes UI Inconsistencies while quoting messages Fixed UI Inconsistencies while quoting messages Jul 13, 2024
@devanshkansagra devanshkansagra marked this pull request as draft July 13, 2024 19:06
@devanshkansagra devanshkansagra marked this pull request as ready for review July 14, 2024 11:25
@devanshkansagra
Copy link
Contributor Author

devanshkansagra commented Jul 14, 2024

Hey maintainers, Can you review my pull request? So that I can follow up any changes if needed

@Spiral-Memory
Copy link
Collaborator

Hey @devanshkansagra

I watched your video, it's looking good ! However in recursive quoting, attachment is not getting displayed right ?

I'll review the code to see if it's not breaking anything..

Thanks a lot for the contribution !

@devanshkansagra
Copy link
Contributor Author

devanshkansagra commented Jul 14, 2024

Hey @devanshkansagra

I watched your video, it's looking good ! However in recursive quoting, attachment is not getting displayed right ?

I'll review the code to see if it's not breaking anything..

Thanks a lot for the contribution !

This issue is there with the main RC, hence it is not able to display the attachment while recursive quoting

@Spiral-Memory
Copy link
Collaborator

Hey @devanshkansagra

I watched your video, it's looking good ! However in recursive quoting, attachment is not getting displayed right ?

I'll review the code to see if it's not breaking anything..

Thanks a lot for the contribution !

This issue is there with the main RC, hence it is not able to display the attachment while recursive quoting

Ohh Okay !

Let me see it, I'll let you know

@devanshkansagra
Copy link
Contributor Author

Sure

@@ -14,6 +14,8 @@ const Attachment = ({ attachment, host, type, variantStyles = {} }) => {
attachment={attachment}
host={host}
variantStyles={variantStyles}
authorIcon={attachment.author_icon}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Send only one prop, i.e., author or authorInfo, and destructure where required. If possible, try not to send extra props. If required, send author.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay will change this

@@ -44,6 +51,42 @@ const Attachment = ({ attachment, host, type, variantStyles = {} }) => {
/>
);
}
if (attachment && attachment.attachments[0]?.image_url) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why introduce redundant rendering of a component? Instead, you can add the required condition where we are already using ImageAttachment, AudioAttachment, and VideoAttachment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was easier for me to implement like this and this is also a conditional based rendering

}) => {
const { RCInstance } = useContext(RCContext);
const { colors } = useTheme();
const getUserAvatarUrl = (icon) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

prop name such as authorUrl here will be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay will change this

return URL;
};
const styles = useQuoteMessageStyles();
const setQuoteMessage = useMessageStore((state) => state.setQuoteMessage);

const { classNames, styleOverrides } = useComponentOverrides('QuoteMessage');

// Function to render the message content or attachment preview
const renderMessageContent = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not have a function here like this, try using JSX with required conditions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay will modify this

@Spiral-Memory Spiral-Memory merged commit d84157f into RocketChat:develop Oct 1, 2024
3 checks passed
@Spiral-Memory
Copy link
Collaborator

Spiral-Memory commented Oct 1, 2024

Thank you for contribution @devanshkansagra
Merging it for testing, will revert back if there are issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] UI inconsistencies in quoted messages
2 participants