fix(configurator): eliminate mobile preview flash + fix narrow-viewport overflow - #317
Conversation
…flow Three mobile UX fixes: 1. Viewport-aware store initialisation — previewOpen and outputOpen now read window.matchMedia at module load time, so the correct value is set on the very first render. The App.svelte effects now only register change listeners (no redundant initial-state assignment), removing the brief flash where the preview slide-over was open before the first effect tick closed it on mobile. 2. Preview viewport buttons — split the label into emoji + text span so the text can be hidden at ≤430 px. Five emoji-only buttons fit easily in the 94 vw slide-over on the narrowest phones; the overflow that was being clipped by overflow:hidden is gone. 3. Close button touch target — raised from 26 × 26 px to min 44 × 44 px at ≤1100 px (WCAG 2.5.5), making it reliably tappable on touch devices. https://claude.ai/code/session_01MAgtQ7JY16X2TqZZyGfkuu
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR refactors viewport-driven UI state initialization by moving logic from component effects into store initialization, and improves Preview component responsive design. The store now computes ChangesViewport breakpoint initialization and responsive UI refinements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
previewOpenandoutputOpenare now initialised directly fromwindow.matchMediaat store creation time, so the correct closed/open state is set before the first render. PreviouslypreviewOpen: truecaused the full-screen slide-over overlay to appear on first paint on mobile, before the$effectcould close it — on slow devices this got stuck and blocked all interaction.<span class="preview__vp-text">. At ≤430 px the text is hidden, leaving five compact emoji-only buttons that fit comfortably in the 94 vw slide-over without any horizontal overflow oroverflow:hiddenclipping.min-width: 44px; min-height: 44pxat ≤1100 px (WCAG 2.5.5 minimum touch target), making it reliably tappable on phones.Test plan
npm testinconfigurator/)https://claude.ai/code/session_01MAgtQ7JY16X2TqZZyGfkuu
Generated by Claude Code
Summary by CodeRabbit