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

chore: scroll-related UX adjustments in the Unleash AI chat #8478

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

nunogois
Copy link
Member

https://linear.app/unleash/issue/2-2857/make-some-scroll-related-ux-adjustments-to-the-unleash-ai-chat

Introduces scroll-related UX enhancements to the Unleash AI chat, providing a smoother and more refined user experience.

Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 1:22pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 1:22pm

Copy link
Contributor

github-actions bot commented Oct 18, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

Looks complicated but I'm ok with it. Just leaving some comments, waiting for the build to succeed (in case changes are significant)

}

return () => {
if (target) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be like this? target will get a reference to the target and the function will just keep it referenced

Suggested change
if (target) {
if (chatEndRef.current) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I simplified this to always use the ref: 8d473e1

@@ -153,7 +180,7 @@ export const AIChat = () => {
minSize={{ width: '270px', height: '200px' }}
maxSize={{ width: '90vw', height: '90vh' }}
defaultSize={{ width: '320px', height: '450px' }}
onResize={scrollToEnd}
onResize={() => scrollToEnd({ onlyIfAtEnd: true })}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we always scroll to end when resizing? I mean if you scroll up on a conversation and then resize...

Copy link
Member Author

Choose a reason for hiding this comment

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

That's why we have onlyIfAtEnd: true. This is actually an improvement on: #8456 (comment)

Copy link
Contributor

@gastonfournier gastonfournier left a comment

Choose a reason for hiding this comment

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

LGTM!

@nunogois nunogois merged commit ffcfe85 into main Oct 18, 2024
11 checks passed
@nunogois nunogois deleted the chore-unleash-ai-chat-scroll-related-ux-adjustments branch October 18, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants