← back to Dear Bubbe Nextjs
mobile-fixes.md
160 lines
# Quick Fixes for Mobile Issues
## Fix 1: Enable Auto-Start for New Users
To fix the auto-start issue where new users don't get greeted automatically, modify `/root/Projects/dear-bubbe-nextjs/app/page.tsx`:
### Current Problem (lines 214-222):
```javascript
// New user - TEXT ONLY trial mode
setAudioUnlocked(false)
setIsConversationActive(false) // ❌ This prevents conversation
setIsVoiceChatActive(false)
setAutoListen(false)
setVoiceEnabled(false) // ❌ This prevents greeting
```
### Quick Fix:
```javascript
// New user - TEXT greeting with voice upgrade prompt
setAudioUnlocked(false) // Keep audio off for trial
setIsConversationActive(true) // ✅ Allow text conversation
setIsVoiceChatActive(false) // No voice chat yet
setAutoListen(false) // Don't auto-listen
setVoiceEnabled(false) // No voice synthesis
setHasAskedLocation(false)
// BUT still show the greeting message!
```
### Line 356 - Change From:
```javascript
} else {
console.log('[AUTO-START] Trial mode - skipping voice synthesis')
}
```
### To:
```javascript
} else {
console.log('[AUTO-START] Trial mode - showing text greeting')
// Text greeting is already displayed above, just ensure conversation can continue
setIsConversationActive(true) // Enable text responses
}
```
## Fix 2: Landscape Mode CSS
Add to `/root/Projects/dear-bubbe-nextjs/app/globals.css`:
```css
/* Mobile Landscape Optimizations */
@media (orientation: landscape) and (max-height: 600px) {
/* Reduce header height in landscape */
header, .header {
padding: 0.5rem !important;
min-height: auto !important;
}
/* Adjust chat container */
.chat-container, main {
max-height: calc(100vh - 100px) !important;
height: calc(100vh - 100px) !important;
}
/* Smaller input area */
.input-area, .sticky.bottom-0 {
padding: 0.5rem !important;
}
/* Hide less important elements */
.text-center.py-12 {
padding: 1rem !important;
}
/* Ensure messages are scrollable */
.overflow-y-auto {
max-height: calc(100vh - 150px) !important;
}
}
/* iPhone X and newer - handle notch */
@supports (padding: max(0px)) {
.sticky.bottom-0 {
padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
}
}
```
## Fix 3: Better Mobile Touch Targets
Update button styles in `/root/Projects/dear-bubbe-nextjs/app/page.tsx`:
Find all button elements and ensure minimum size:
```javascript
// Current:
className="... px-4 py-2 ..."
// Change to:
className="... px-4 py-3 min-w-[48px] min-h-[48px] ..."
```
## Fix 4: Improve Trial Experience Message
In the welcome message for new users, make it clear they can upgrade for voice:
```javascript
// In forceStart() function around line 285
const initMessage = isReturningUser
? `__returning_user_with_weather__${weatherData || ''}`
: '__init_trial__' // New special message for trial users
```
Then in the API handler, return a message like:
```
"Oy vey, another schmuck needs advice? I'm Bubbe, your AI Jewish grandmother. What's wrong with your life now? And why aren't you married yet?
💬 Text me your problems - I'll judge them for free (3 messages)
🎤 Want to HEAR me kvetch? Sign up for voice chat!"
```
## Implementation Steps:
1. **Test current state**:
```bash
node /root/Projects/dear-bubbe-nextjs/mobile-test-quick.js
```
2. **Apply Fix 1** (auto-start for new users)
3. **Apply Fix 2** (landscape CSS)
4. **Test again**:
```bash
node /root/Projects/dear-bubbe-nextjs/mobile-test-quick.js
```
5. **Deploy**:
```bash
cd /root/Projects/dear-bubbe-nextjs
npm run build
pm2 restart bubbe-ai
```
## Validation Checklist:
- [ ] New users see greeting immediately (no click required)
- [ ] Text chat works for trial users
- [ ] Voice prompt appears after 3 messages
- [ ] Landscape mode doesn't break layout
- [ ] All buttons are at least 48x48px
- [ ] No console errors
- [ ] Response time < 2 seconds
## Expected Results After Fixes:
- **New User Experience**: Land → See greeting → Can respond via text
- **Trial Flow**: 3 text messages → Signup prompt → Voice unlocked
- **Returning User**: Land → Voice greeting → Auto-listening
- **Mobile UX**: Proper landscape, larger touch targets, smooth scrolling