# Sprint 2.5: Mobile-First UI Refactor (URGENT) **Date**: 2025-12-09 **Status**: ๐Ÿ”ด Critical Priority **Duration**: 2-3 hours **Reason**: Cultivation floor workers use tablets/phones - desktop-first won't work --- ## ๐ŸŽฏ Objective Refactor the entire frontend to be **mobile-first** with proper responsive breakpoints for tablet and desktop use. --- ## ๐Ÿ“ฑ Mobile-First Principles ### Target Devices 1. **Primary**: Tablets (iPad, Android tablets) - 768px-1024px 2. **Secondary**: Large phones - 375px-767px 3. **Tertiary**: Desktop - 1024px+ ### Design Requirements - **Minimum tap target**: 44ร—44px (Apple HIG standard) - **Font sizes**: Minimum 16px for body text (prevents zoom on iOS) - **Spacing**: Generous padding/margins for fat-finger taps - **Dark mode**: Default (easier on eyes in grow rooms) - **Landscape support**: Tablets often used in landscape --- ## ๐Ÿ”ง Implementation Plan ### Phase 1: Tailwind Configuration (30 min) #### Task 2.5.1: Update Tailwind Config - [ ] Add custom breakpoints optimized for tablets - [ ] Set mobile-first defaults - [ ] Add touch-friendly spacing scale - [ ] Configure larger tap targets ```javascript // Proposed breakpoints screens: { 'xs': '375px', // Large phones 'sm': '640px', // Small tablets portrait 'md': '768px', // Tablets portrait 'lg': '1024px', // Tablets landscape / small desktop 'xl': '1280px', // Desktop '2xl': '1536px', // Large desktop } ``` #### Task 2.5.2: Update Base Styles - [ ] Increase base font size to 16px - [ ] Add touch-friendly button styles - [ ] Increase form input sizes - [ ] Add mobile-optimized spacing utilities --- ### Phase 2: Component Refactor (1-1.5 hours) #### Task 2.5.3: Update Layout Components - [ ] **App.tsx**: Mobile-first layout structure - [ ] **Navigation**: Bottom nav for mobile, side nav for tablet+ - [ ] **Header**: Compact mobile header with hamburger menu - [ ] **Cards**: Stack on mobile, grid on tablet+ #### Task 2.5.4: Update Page Components - [ ] **LoginPage**: Full-screen on mobile, centered card on tablet+ - [ ] **DashboardPage**: Single column mobile, 2-col tablet, 3-col desktop - [ ] **RoomsPage**: List view mobile, grid tablet+ - [ ] **BatchesPage**: List view mobile, grid tablet+ - [ ] **TimeclockPage**: Large buttons for easy tapping #### Task 2.5.5: Update UI Components - [ ] **Buttons**: Minimum 44px height, generous padding - [ ] **Forms**: Large inputs (min 44px height) - [ ] **Tables**: Horizontal scroll on mobile, full on tablet+ - [ ] **Modals**: Full-screen on mobile, centered on tablet+ --- ### Phase 3: Touch Optimization (30-45 min) #### Task 2.5.6: Touch-Friendly Interactions - [ ] Increase all clickable areas to 44ร—44px minimum - [ ] Add active states for touch feedback - [ ] Remove hover-only interactions - [ ] Add swipe gestures where appropriate #### Task 2.5.7: Performance Optimization - [ ] Lazy load images - [ ] Optimize bundle size - [ ] Add loading skeletons - [ ] Test on actual devices --- ## ๐Ÿ“ Responsive Patterns ### Stack to Grid ```jsx // Mobile: Stack // Tablet+: Grid
``` ### Hide/Show Elements ```jsx // Mobile: Hidden // Tablet+: Visible
Desktop content
// Mobile: Visible // Tablet+: Hidden
Mobile content
``` ### Responsive Text ```jsx

``` ### Responsive Spacing ```jsx
``` --- ## ๐ŸŽจ Mobile-First Component Examples ### Button Component ```tsx // Minimum 44px height, large text, generous padding ``` ### Card Component ```tsx // Full width mobile, constrained tablet+
``` ### Navigation ```tsx // Bottom nav mobile, side nav tablet+