-
Notifications
You must be signed in to change notification settings - Fork 205
DRAFT - DO NOT MERGE - TEST PR ONLY #3551
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: develop
Are you sure you want to change the base?
DRAFT - DO NOT MERGE - TEST PR ONLY #3551
Conversation
✨ New Features: - Product comparison with up to 4 products - Side drawer for quick comparison management - Dedicated comparison page with responsive design - Floating comparison badge for easy access - localStorage persistence across sessions 🏗️ Implementation: - ComparisonProvider context for global state management - useComparison hook for easy integration - CompareButton component with icon and button variants - ComparisonDrawer for quick product management - ComparisonBadge floating indicator - ProductComparison page with detailed comparison table 🔧 Integration Points: - Added compare buttons to ProductTile components - Integrated comparison into ProductView (product detail page) - Enabled comparison on product list pages - Added /compare route for full comparison experience 🧪 Testing & Quality: - Comprehensive unit tests for hook and components - Accessibility features (ARIA labels, keyboard navigation) - Internationalization support with react-intl - Error handling and user feedback via toasts 📱 User Experience: - Responsive design (table on desktop, cards on mobile) - Smooth animations and transitions - Toast notifications for user feedback - Maximum 4 products limit with duplicate prevention 📚 Documentation: - Complete feature documentation in PRODUCT_COMPARISON.md - Code examples and usage patterns - API documentation for all components and hooks This feature enables users to compare products side-by-side with a seamless, accessible, and responsive experience following PWA Kit best practices.
|
Thanks for the contribution! Before we can merge this, we need @szirpe to sign the Salesforce Inc. Contributor License Agreement. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| duration: 2000 | ||
| }) | ||
| } | ||
| } catch (error) { |
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.
catch is not needed
| expect(screen.getByText(/removed from comparison/i)).toBeInTheDocument() | ||
| }) | ||
|
|
||
| test('prevents adding when maximum products reached', async () => { |
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.
This test is redundant.
Summary
This PR introduces a complete product comparison feature that allows users to compare up to 4 products side-by-side, with persistent state across browser sessions.
Features Added
Core Functionality
New Components
/compareIntegration Points
Technical Details
Files Added
PRODUCT_COMPARISON.md- Complete feature documentationapp/components/compare-button/- Button component with testsapp/components/comparison-badge/- Floating badge componentapp/components/comparison-drawer/- Side drawer componentapp/contexts/comparison-provider.jsx- Context providerapp/hooks/use-comparison.js- Hook with testsapp/pages/product-comparison/- Comparison pageUser Experience
Accessibility
Testing
Documentation
Complete documentation in
PRODUCT_COMPARISON.mdincluding: