mobile-client-guardrails
Guardrails for mobile client development (loh-mobile)
Mobile Client Guardrails (loh-mobile)
1. Touch-First Design
Rule: All gameplay and UI interactions MUST be usable via touch.
- Size Targets: Touch targets must be at least 44x44 points (approx 7-10mm physical size).
- Gestures: Support standard gestures (tap, drag, pinch) where intuitive.
- No Hover: Do NOT rely on hover states for critical information. Use "press and hold" or toggle clicks for tooltips.
2. Screen Space & Layout
- SafeArea: Respect safe areas (notches, dynamic islands, home bars) on iOS and Android.
- Responsive UI: UI must adapt to various aspect ratios (16:9, 19.5:9, 4:3 on iPad/Tablets).
- Text Readability: Minimum font size of 12sp for readability on small screens.
3. Performance & Battery
- Frame Rate: Target 30fps default for battery saving, with 60fps optional toggle.
- V-Sync: Always enabled to prevent tearing and wasted battery.
- Optimized Assets: Use compressed texture formats (ASTC/ETC2).
4. Platform Compliance
- Permissions: Request permissions (Camera, Location, etc.) only when needed and with context.
- Privacy, Data collection must be transparent and user-authorized.
5. Implementation Standards
- Conditional Compilation: Use
#[cfg(target_os = "android")]or#[cfg(target_os = "ios")]for platform-specific code. - Asset Loading: Ensure assets are bundled correctly and loaded asynchronously.
6. Build & Deploy
- ** targets**:
aarch64-linux-androidandaarch64-apple-iosmust always compile. - Signing: Debug builds can use debug keys, but Release builds must use secure signing config (handled in CI/CD).