-
Notifications
You must be signed in to change notification settings - Fork 72
[LG-5575] refactor(chat): remove spacious variant, remove div from LeafyGreenChatProvider, and remove peer dep if unnecessary #3294
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c34830b The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
Size Change: -23.3 kB (-1.29%) Total Size: 1.79 MB
ℹ️ View Unchanged
|
7110790 to
2c729f9
Compare
b5007d8 to
d31112a
Compare
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.
Pull Request Overview
This PR removes the deprecated "spacious" variant from the LeafyGreen Chat system, simplifying all chat components to use a single, consistent design. The changes eliminate variant-specific conditional logic throughout the codebase and remove the @lg-chat/leafygreen-chat-provider peer dependency from components that no longer need it.
Key changes:
- Removed
Variantenum andvariantprop fromLeafyGreenChatProvider - Eliminated spacious variant-specific props across all chat components (
align,avatar,baseFontSize,iconSlot,onClose, etc.) - Removed deprecated style exports and several component exports (e.g.,
MessageContainer,PopoverMessageFeedback,RadioButton)
Reviewed Changes
Copilot reviewed 123 out of 147 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
chat/leafygreen-chat-provider/src/LeafyGreenChatProvider/LeafyGreenChatProvider.tsx |
Removed ResizeObserver, containerWidth tracking, and variant prop; simplified provider to only manage assistantName |
chat/message/src/Message/Message.tsx |
Consolidated CompactMessage and SpaciousMessage into single Message component implementation |
chat/title-bar/src/TitleBar/TitleBar.tsx |
Removed Avatar, IconButton, and variant-specific rendering logic |
chat/input-bar/src/InputBar/InputBar.tsx |
Removed badge, gradient animation, hotkey indicator, and variant-specific button rendering |
chat/message-rating/src/MessageRating/MessageRating.tsx |
Removed RadioButton variant and description prop |
chat/message-feedback/src/InlineMessageFeedback/InlineMessageFeedback.tsx |
Removed cancel button and variant-specific layout logic |
chat/message-feed/src/MessageFeed/MessageFeed.tsx |
Consolidated CompactMessageFeed and SpaciousMessageFeed into single implementation |
chat/input-bar/package.json |
Updated react-textarea-autosize dependency from ^8.3.2 to ^8.5.9 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
36f3423 to
0c56610
Compare
…atProvider, and remove peer dep if unnecessary
0c56610 to
c34830b
Compare
stephl3
left a comment
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.
UI Tests have changed slightly now that I've decoupled most chat components from the LeafyGreenChatProvider. This also had a wrapper <div> element included in the provider, but now that it has been removed from stories, the snapshots should appear centered in most cases
| export const interceptStyles = css` | ||
| min-height: 1px; | ||
| `; |
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.
Most changes are removal of code. This is one spot I added something.
MessageFeed has 2 empty spans, aka intercepts. Their visibility is checked to determine if overflow shadows should be rendered. In certain containers, like a drawer UI, the browser was not considering the bottom intercept, so I added this min-height of 1px to ensure it was considered
|
Coverage after merging steph/chat-rm-spacious into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
shaneeza
left a comment
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.
I forgot to leave a comment, but everything looks good! I just had a few questions, and I left a few comments in Chromatic.
| "@leafygreen-ui/drawer": "workspace:^", | ||
| "@lg-chat/avatar": "workspace:^", | ||
| "@lg-chat/input-bar": "workspace:^", | ||
| "@lg-chat/leafygreen-chat-provider": "workspace:^", |
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.
I don't think this is correct. I think it should remain a peer
✍️ Proposed changes
This PR removes the spacious variant system from the chat components, which was previously deprecated in favor of the compact variant. The changes include:
Variantenum and all variant-related logic fromLeafyGreenChatProviderlgMessageFeedStyles,lgInputBarStyles,lgMessageStyles, etc.)PopoverMessageFeedback,RadioButton,MessageContainer, andCompactMessageFeeddescriptionfromMessageRating,isCompactandshouldRenderButtonTextfromInputBarSendButton, andbaseFontSizefromMessageContentonCloseandiconSlotprops fromChatWindowandTitleBarThis is a breaking change that simplifies the chat component API by removing the deprecated spacious variant and consolidating on a single, consistent compact design.
🎟️ Jira ticket: LG-5575
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes
variantprop onLeafyGreenChatProvider