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: make the Unleash AI chat resizable #8456

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

nunogois
Copy link
Member

https://linear.app/unleash/issue/2-2840/make-the-unleash-ai-chat-window-resizable

This PR makes the Unleash AI chat resizable, providing users with a flexible way to adjust the chat window's size.

Implements a reusable Resizable wrapper component that allows configuration of:

  • Minimum, maximum, and default sizes.
  • Customizable resize handlers for each edge and corner of the container.
  • Optional resize event callbacks.

Double-clicking any resize handler maximizes the container along that axis (or both, if it's a corner). If the container is already maximized, double-clicking again will revert it to the default size.

Copy link

vercel bot commented Oct 15, 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 15, 2024 4:57pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Oct 15, 2024 4:57pm

Copy link
Contributor

github-actions bot commented Oct 15, 2024

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

minSize={{ width: '270px', height: '200px' }}
maxSize={{ width: '90vw', height: '90vh' }}
defaultSize={{ width: '320px', height: '450px' }}
onResize={scrollToEnd}
Copy link
Contributor

Choose a reason for hiding this comment

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

I can see cases where this would be annoying, ie you scroll up in history and then resize to read something without too many line breaks. But not sure the need would arise in here

Copy link
Member Author

Choose a reason for hiding this comment

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

If you try this locally I think you'll understand why I did this. If we don't do something like this, whenever you resize, the conversation content container will anchor to the top left.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll keep it for now but we can remove this behavior if we get feedback about it.

Copy link
Contributor

@daveleek daveleek left a comment

Choose a reason for hiding this comment

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

Nice, weird that there's no good component for this already in MUI

@nunogois
Copy link
Member Author

Nice, weird that there's no good component for this already in MUI

Honestly, I didn’t check MUI before starting this implementation, but from what I can tell, it doesn’t seem like there’s a built-in component for this. The resizing behavior we’re going for is a bit niche, so it’s not something you see commonly implemented in web UI libraries.

@nunogois nunogois merged commit 9a98f86 into main Oct 16, 2024
11 checks passed
@nunogois nunogois deleted the chore-unleash-ai-chat-resizable branch October 16, 2024 08:15
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