You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(Album): integrate Embla carousel and fix critical UX issues
Implements Embla Carousel's Thumbnails pattern for AlbumViewer with proper
API-to-API synchronization and fixes three critical UX regressions.
## Embla Carousel Integration
### AlbumViewer
- Replace custom photo navigation with Embla carousel
- Implement swipe gestures for photo navigation
- Add carousel API for synchronization with FilmStrip
- Support empty album states (hideWhenEmpty, custom empty content)
- Add proper keyboard navigation with Embla API
### FilmStrip
- Convert from basic scrolling to Embla carousel with vertical axis
- Enable drag-free scrolling for natural thumbnail navigation
- Implement API-to-API sync with main photo carousel
- Add vertical centering wrapper for better UX
### Responsive Design
- Implement 3-breakpoint system (640px tablet, 768px desktop, 1024px desktop-wide)
- Progressive padding enhancement across breakpoints
- Sidebar visibility aligned with padding breakpoints (640px)
## Bug Fixes
### 1. hideWhenEmpty Effects Issue
**Problem**: Body scroll lock and keyboard listeners mounted before early return,
freezing page scroll when component returned null.
**Solution**: Added isViewerVisible flag to conditionally run effects only when
viewer is actually rendered, preventing UX regression in "Hide When Empty" story.
### 2. FilmStrip Thumbnail Clicks
**Problem**: Thumbnail clicks no-op when mainApi undefined/null, breaking standalone
use and early clicks before API ready.
**Solution**: Always call onSelect first, then conditionally scroll mainApi if available.
### 3. Mouse-Wheel Scrolling
**Problem**: FilmStrip used Embla with overflow:hidden and no wheel support, removing
mouse-wheel scrolling for desktop users.
**Solution**: Added embla-carousel-wheel-gestures plugin for proper desktop accessibility.
## Documentation
- Updated Album pattern docs with comprehensive responsive behavior section
- Documented all three breakpoints and their behaviors
- Added feature descriptions mentioning Embla carousel integration
Fixes page scroll lock, thumbnail click handling, and desktop accessibility issues.
Fullscreen photo viewer props including empty state handling
778
+
</p>
779
+
</header>
780
+
<PropsTable
781
+
hideThemeColumn
782
+
rows={[
783
+
{
784
+
name: 'album',
785
+
description: 'Album object to display. Type: Album (required)',
786
+
},
787
+
{
788
+
name: 'initialPhotoIndex',
789
+
description: 'Initial photo index to display - default: 0',
790
+
},
791
+
{
792
+
name: 'onClose',
793
+
description: 'Callback when viewer is closed: () => void',
794
+
},
795
+
{
796
+
name: 'className',
797
+
description: 'Additional CSS class name for the viewer',
798
+
},
799
+
{
800
+
name: 'emptyStateContent',
801
+
description: 'Custom content to display when album has no photos. If not provided, shows default empty state with message and close button. Type: React.ReactNode',
802
+
},
803
+
{
804
+
name: 'hideWhenEmpty',
805
+
description: 'Hide the viewer completely when album has no photos. When true, returns null instead of showing empty state - default: false',
0 commit comments