-
Notifications
You must be signed in to change notification settings - Fork 66
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
LG-4789: Chat MessageFeed Scroll to Latest Button #2648
Conversation
🦋 Changeset detectedLatest commit: 291e271 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// Wait until scroll animation completes | ||
scrollTimerRef.current = setTimeout(() => { | ||
setShowScrollButton(!isScrolledToEnd()); | ||
}, 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this an arbitrary value or does it correspond with a transition duration? can we make it a constant to better capture why we use 100?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently arbitrary, though it works fine on the longest messages that our chatbot returns - scrollTo
is pretty quick.
Longer term I'd like to explore making this not use a timer and instead run on scroll end. However, the scrollend
event isn't supported in Safari and there isn't a built-in callback so the timer will have to do for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nlarew there's an issue with our lint check in CI that we need to check out. In the meantime, can you run pnpm fix
locally to fix these lint issues: https://github.com/mongodb/leafygreen-ui/actions/runs/12916471164/job/36021239154?pr=2648
Size Change: +1.79 kB (+0.13%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✍️ Proposed changes
🎟 Jira ticket: LG-4789
✅ Checklist
For bug fixes, new features & breaking changes
pnpm changeset
and documented my changesFor new components
🧪 How to test changes
scroll-to-latest.mov