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

Made bubble height width configurable through props. #945

Closed
wants to merge 4 commits into from

Conversation

prateekkalra
Copy link
Contributor

@prateekkalra prateekkalra commented Oct 17, 2023

/claim #458
Made bubble height width configurable through props.

Please find default height width screenshot below.

image

Summary by CodeRabbit

  • New Feature: Introduced customizable dimensions for chat bubbles. Users can now specify the height and width of the chat bubbles, providing greater flexibility in adapting the chat interface to different layouts and designs. If no dimensions are specified, the system will use default values, ensuring a consistent user experience. This update enhances the visual adaptability of our chat feature, making it more user-friendly and versatile for various display settings.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2023

Walkthrough

The changes introduced in this pull request primarily focus on enhancing the customization of the chat bubble component. The Bubble component and the BubbleTheme interface have been updated to include optional height and width properties, allowing users to specify the dimensions of the chat bubble.

Changes

File Path Summary
.../bubble/components/Bubble.tsx Added height and width optional props to the BubbleProps interface. The Bubble component now sets the height and width styles of the bot div based on these props, with fallback values if not provided.
.../bubble/types.ts Introduced height and width optional properties to the BubbleTheme interface, enabling the specification of the chat bubble's dimensions.

Walkthrough

The changes introduced in this pull request primarily focus on enhancing the customization of the Bubble component. The BubbleProps and BubbleTheme interfaces have been extended to include optional height and width properties. These properties allow users to specify the dimensions of the chat bubble, providing a more flexible user experience.

Changes

File Path Summary
.../bubble/components/Bubble.tsx Added height and width optional props to the BubbleProps interface. The Bubble component now sets its dimensions based on these props, with fallback values if not provided.
.../bubble/types.ts Introduced height and width optional properties to the BubbleTheme interface, allowing the specification of the chat bubble's dimensions.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.

Note: For conversation with the bot, please use the review comments on code diffs or files.

@vercel
Copy link

vercel bot commented Oct 17, 2023

@prateekkalra is attempting to deploy a commit to the Typebot Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Commits Files that changed from the base of the PR and between df3a17e and 87a7e8b.
Files selected for processing (2)
  • packages/embeds/js/src/features/bubble/components/Bubble.tsx (3 hunks)
  • packages/embeds/js/src/features/bubble/types.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/embeds/js/src/features/bubble/types.ts
Additional comments (Suppressed): 2
packages/embeds/js/src/features/bubble/components/Bubble.tsx (2)
  • 20-24: The BubbleProps interface has been extended to include optional height and width properties. This allows for greater customization of the chat bubble's dimensions. Ensure that all uses of the Bubble component throughout the codebase are compatible with these new properties.

  • 166-167: The w-full class has been removed from the bot part's class list. This could affect the chat bubble's width on small screens. Ensure that this change does not negatively impact the chat bubble's appearance or functionality on small screens.

Copy link
Owner

@baptisteArno baptisteArno left a comment

Choose a reason for hiding this comment

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

Here is what I have as default size:

CleanShot 2023-10-18 at 15 13 42@2x

@prateekkalra
Copy link
Contributor Author

The difference in images might be due to screen resolution.
The default width should be same as what it is right now, in the live version ? Is it not ?

@baptisteArno
Copy link
Owner

The difference in images might be due to screen resolution. The default width should be same as what it is right now, in the live version ? Is it not ?

Width is ok in my screenshot, it's the height that is not! Please checkout the main branch to check the default styling 🙏

@prateekkalra
Copy link
Contributor Author

Sure @baptisteArno
Will fix it.Thanks 🙂

@prateekkalra
Copy link
Contributor Author

Hi @baptisteArno
I checked again, the height in both the main branch and my branch looks exactly similar.
Did you check out this branch and test?

@baptisteArno
Copy link
Owner

It should look like this by default:

CleanShot 2023-10-20 at 07 53 00@2x

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 87a7e8b and 2928200.
Files selected for processing (1)
  • packages/embeds/js/src/features/bubble/components/Bubble.tsx (3 hunks)
Additional comments (Suppressed): 3
packages/embeds/js/src/features/bubble/components/Bubble.tsx (3)
  • 23-24: The addition of height and width properties to the BubbleProps interface allows for greater customization of the chat bubble's dimensions. This is a good change as it enhances the flexibility of the component's usage. However, it would be beneficial to add a comment explaining what units these properties should be in (e.g., pixels, em, etc.) to avoid any confusion for future developers.

  • 150-154: The height and width properties are used to set the height and width styles of the bot div. If the properties are not provided, fallback values are used. This is a good approach as it ensures that the chat bubble will have default dimensions if no specific dimensions are provided. However, the width fallback value includes an !important flag, which is generally discouraged as it can make debugging more difficult by breaking the natural cascading in your stylesheets. Consider removing this flag if it's not necessary.

  • 165-166: The width property is removed from the class string. This is consistent with the addition of the width property to the BubbleProps interface and the use of this property to set the width style of the bot div. However, ensure that this change does not affect the layout of the chat bubble in unexpected ways, especially in different screen sizes and resolutions.

@prateekkalra
Copy link
Contributor Author

@baptisteArno You were right about the height issue. It was looking same for me, because of the smaller resolution in my laptop. Pushed a fix to align the default height with main branch. Removed max-height, since it's already been taken care by the tailwind class.
Let me know if you still have any issues.
Thank you 🙂

@baptisteArno
Copy link
Owner

Sorry the issue lacked some context and clear scope. I'll close this as it does not fully satisfy what I was thinking about 🙏

@baptisteArno
Copy link
Owner

/tip 10

Copy link

algora-pbc bot commented Nov 14, 2023

🎉🎈 @prateekkalra has been awarded $10! 🎈🎊

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.

2 participants