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

feat: Jump to last message WPB-6518 #17386

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

svitovyda
Copy link
Contributor

@svitovyda svitovyda commented May 10, 2024

StoryWPB-6518 [Web] Jump to last message in a conversation

Description

By the product/design team request, the user should jump to the very last message in the conversation, marking all the messages as read

Screenshots/Screencast (for UI changes)

Checklist

  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

Important details for the reviewers

(Delete this section if unnecessary)

  • can be reviewed commit-by-commit
  • be sure to look at ...

@CLAassistant
Copy link

CLAassistant commented May 10, 2024

CLA assistant check
All committers have signed the CLA.

isVisible: boolean;
}

export interface LastMessageTrackerProps extends HTMLProps<HTMLElement> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be a separate component as we want to avoid the entire content of Conversation to re-render each time messages are scrolled and messages visibility changes

@@ -88,6 +89,7 @@ export const Message: React.FC<MessageParams & {scrollTo?: ScrollToElement}> = p
isHighlighted,
hideHeader,
onVisible,
onVisibilityChange,
Copy link
Contributor Author

@svitovyda svitovyda May 10, 2024

Choose a reason for hiding this comment

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

I know this is weird, but as isVisible was implemented till now, it would be triggered only the first time (and if it's added as the item of the list one by one, and then disappear from the visible area - it will still be called). I don't mind merging them at least on the Message and the level of its usage, but I want to hear your opinions on how to do it the best

@svitovyda svitovyda force-pushed the feat/WPB-6518-jump_to_last_message branch from 70bff5b to caec31b Compare May 10, 2024 15:47
…sage;

Mark all the conversation as read on the "jump to last message" button click;
Reload the conversation on the "jump to last message" click if the latest conversation messages were not load;
@svitovyda svitovyda force-pushed the feat/WPB-6518-jump_to_last_message branch from caec31b to 691c0bc Compare May 16, 2024 12:26
Copy link

sonarcloud bot commented May 16, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

None yet

3 participants