-
Notifications
You must be signed in to change notification settings - Fork 72
[LG-5438|LG-5440] feat(message-prompts): add refresh button and hide-on-select transition #3188
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
Conversation
🦋 Changeset detectedLatest commit: 156f355 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 |
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 enhances the MessagePrompts component with two new features: an optional refresh button and a hide-on-select transition animation. The refresh button appears when the onClickRefresh prop is provided and becomes disabled after prompt selection. The hide-on-select feature (enabled by default) adds a smooth fade/shrink animation when a prompt is selected, using CSS Grid transitions.
- Adds refresh button functionality with
onClickRefreshprop - Implements hide-on-select transition with
enableHideOnSelectprop (default: true) - Includes comprehensive test coverage and updated documentation
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/emotion/src/version.ts | Version bump for emotion package |
| chat/message-prompts/tsconfig.json | Added TypeScript references for icon and icon-button dependencies |
| chat/message-prompts/src/MessagePrompts/MessagePrompts.types.ts | Added type definitions for new props: enableHideOnSelect and onClickRefresh |
| chat/message-prompts/src/MessagePrompts/MessagePrompts.tsx | Core implementation of refresh button and hide-on-select transition |
| chat/message-prompts/src/MessagePrompts/MessagePrompts.styles.ts | New CSS Grid-based transition styles for hide-on-select animation |
| chat/message-prompts/src/MessagePrompts/MessagePrompts.spec.tsx | Comprehensive test coverage for new features |
| chat/message-prompts/src/MessagePrompts.stories.tsx | Updated Storybook stories demonstrating new functionality |
| chat/message-prompts/src/MessagePrompt/MessagePrompt.types.ts | Type improvements and better click handler typing |
| chat/message-prompts/src/MessagePrompt/MessagePrompt.tsx | Refactored styles and improved click handling logic |
| chat/message-prompts/src/MessagePrompt/MessagePrompt.styles.ts | Converted to function-based style generation for better maintainability |
| chat/message-prompts/src/MessagePrompt/MessagePrompt.spec.tsx | Added comprehensive test suite for MessagePrompt component |
| chat/message-prompts/package.json | Added dependencies for icon, icon-button, and storybook test utilities |
| chat/message-prompts/README.md | Updated documentation with examples and prop descriptions |
| chat/chat-window/src/ChatWindow.stories.tsx | Added story demonstrating integration with ChatWindow |
| .changeset/tidy-sloths-nail.md | Changelog entry documenting the new features |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
|
Size Change: +974 B (+0.06%) Total Size: 1.59 MB
ℹ️ View Unchanged
|
e54662b to
0f7b425
Compare
…s, and refactor styles
…etween prompt and first message
c2dbcc4 to
156f355
Compare
✍️ Proposed changes
This PR enhances the
MessagePromptscomponent with two new features:Refresh Button (
onClickRefreshprop): Adds an optional refresh IconButton that appears next to the label. The button becomes disabled once a prompt is selected, preventing accidental refreshes after user engagement.Hide-on-Select Transition (
enableHideOnSelectprop): Adds a smooth exit animation that fades out and collapses the prompts container to the bottom-right corner when a prompt is selected. This transition uses CSS Grid (grid-template-rows: 1fr → 0fr), opacity, and transform for a polished user experience. This feature is enabled by default (true).Additional improvements include comprehensive test coverage, Storybook examples, updated documentation, and a new
ChatWindowstory demonstrating the full integration.🎟️ Jira ticket: LG-5438 | LG-5440
✅ Checklist
pnpm changesetand documented my changes🧪 How to test changes
Test Refresh Button:
MessagePromptsstory in StorybookWithRefreshstoryTest Hide-on-Select Transition:
SelectedWithHideOnSelectstoryenableHideOnSelect={false}prevents the animationTest ChatWindow Integration:
WithMessagePromptsstory in ChatWindowRun Tests:
pnpm lg test message-prompts