59 Commits

Author SHA1 Message Date
Sergei
516dc37527 Add retry button for individual failed sensors on results screen
- Added handleRetryFromResults function to retry setup for a single sensor
- Added Retry button next to each failed/skipped sensor in the results list
- When clicked, resets sensor state and returns to batch setup phase
- Added new styles: resultItemWithAction, resultItemLeft, retryItemButton

TASK-6.2: Add results screen after batch setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 23:00:32 -08:00
Sergei
ca820b25fb Add progress UI enhancements for batch sensor setup
- Add sensor index badge (1/5, 2/5...) on each card
- Add elapsed time display for processing sensors
- Add auto-scroll to current active sensor
- Add animated progress bar with success/error segments
- Add stats row showing success/error/skipped counts
- Improve visual feedback during batch WiFi setup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 22:55:10 -08:00
Sergei
be1c2eb7f5 Refactor Setup WiFi screen for batch sensor processing
- Add SensorSetupState and BatchSetupState types for tracking sensor setup progress
- Create BatchSetupProgress component with step-by-step progress UI
- Implement sequential sensor processing with:
  - Connect → Unlock → Set WiFi → Attach → Reboot steps
  - Error handling with Retry/Skip options for each sensor
  - Pause on failure, resume on retry/skip
  - Cancel all functionality
- Add results screen showing success/failed sensors
- Support processing multiple sensors with same WiFi credentials

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 22:47:48 -08:00
Sergei
b738d86419 Update navigation to pass selected devices array
- add-sensor.tsx now passes devices array with mac address via JSON
- setup-wifi.tsx parses devices from navigation params
- Support batch mode display (shows count and device names)
- Disconnect all devices when navigating back

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 22:43:12 -08:00
Sergei
52def3cb79 Show placeholder for empty location in Equipment screen
Display "No location set" in italic style when sensor has no location configured.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-19 22:38:39 -08:00
Sergei
5092678430 Add device settings screen
Features:
- Device metadata display (name, MAC, location, description)
- Edit device name and description
- Update WiFi credentials (reconnect flow)
- Remove device from beneficiary
- Device history and diagnostics

UI:
- Clean settings form with validation
- Delete confirmation dialog
- Success/error feedback
- Navigation back to equipment list on changes

Route: /(tabs)/beneficiaries/[id]/device-settings/[deviceId]
2026-01-14 19:08:09 -08:00
Sergei
3c3283e424 Add WiFi setup flow for WP sensors
Sensor onboarding screens:
- add-sensor.tsx: BLE scanning + device selection
- setup-wifi.tsx: WiFi credentials + ESP32 provisioning

Flow:
1. Scan for nearby sensors via BLE
2. Select device from list
3. Enter WiFi credentials (SSID + password)
4. Send config over BLE using ESP IDF provisioning protocol
5. Verify connection and activate in backend

ESP Provisioning:
- services/espProvisioning.ts: ESP32 BLE provisioning implementation
- Protocol: custom-data exchange via BLE characteristics
- Security: WiFi password encrypted over BLE
- Timeout handling: 30s for provisioning, 60s for activation

User experience:
- Clear step-by-step wizard UI
- Loading states for BLE operations
- Success/error feedback
- Navigation to equipment screen on success
2026-01-14 19:07:57 -08:00
Sergei
86e73f004d Add BLE infrastructure for sensor connectivity
Core BLE system:
- BLEManager: Real BLE device scanning and connection (iOS/Android)
- MockBLEManager: Simulator-safe mock for development
- BLEContext: React context for BLE state management
- BLEProvider: Added to app/_layout.tsx

Bluetooth permissions:
- iOS: NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription
- Android: BLUETOOTH, BLUETOOTH_ADMIN, BLUETOOTH_CONNECT, BLUETOOTH_SCAN, ACCESS_FINE_LOCATION

Dependencies:
- react-native-ble-plx@3.5.0
- expo-device@8.0.10
- react-native-base64@0.2.2

Simulator support:
- Auto-detects iOS simulator via expo-device
- Falls back to MockBLEManager with fake devices
- No crashes or permission errors in development
2026-01-14 19:07:44 -08:00
Sergei
3aee73a731 Add WP sensor status system with BLE scanning
Implemented three-tier sensor status (online/warning/offline) with visual indicators and BLE scanning for nearby devices.

Features:
- WPSensor type with status field (online/warning/offline)
- Automatic status calculation based on lastSeen time:
  • Online: < 5 minutes (fresh data)
  • Warning: 5 min - 1 hour (potential issue)
  • Offline: > 1 hour (definitely problem)
- Dual sensor display: Connected (API) + Available Nearby (BLE)
- BLE scanning button for discovering nearby WP sensors
- Action Sheet for offline sensors with Reconnect/Remove options
- Updated summary card: Total/Online/Warning/Offline counts
- Visual status indicators: colored dots and labels
- Graceful error handling for API unavailability

Files changed:
- types/index.ts: Added WPSensor interface with status and source fields
- services/api.ts: Updated getDevicesForBeneficiary with status calculation
- equipment.tsx: Complete UI overhaul with BLE scanning and two-tier sensor list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 19:03:06 -08:00
Sergei
5c8c3665da Profile avatar cloud upload + test bundle ID
- Profile avatar now uploads to MinIO cloud storage via /auth/avatar endpoint
- Added loading indicator (ActivityIndicator) during avatar upload
- Avatar loads from cloud URL (user.avatarUrl) first, with SecureStore fallback
- Changed iOS bundleIdentifier to com.serter2069.wellnuo.test (test account)
2026-01-12 21:53:53 -08:00
Sergei
5e0b38748b Update Stripe integration, API services, and purchase screens
- Update purchase screens (auth and beneficiary)
- Update Stripe configuration and setup scripts
- Update api.ts services
- Update espProvisioning and sherpaTTS services
- Update verify-otp flow
- Package updates
2026-01-12 21:44:57 -08:00
Sergei
429a18d1eb Fix Edit navigation from menu + add avatar upload indicator
- BeneficiaryMenu: Navigate with ?edit=true param to open edit modal
- Beneficiary index: Auto-open edit modal when edit=true in URL
- Add loading indicator on Save button during edit save
- Add "Uploading..." overlay on avatar during image upload
2026-01-12 21:44:40 -08:00
Sergei
7105bb72f7 Stable Light version - App Store submission
WellNuo Lite architecture:
- Simplified navigation flow with NavigationController
- Profile editing with API sync (/auth/profile endpoint)
- OTP verification improvements
- ESP WiFi provisioning setup (espProvisioning.ts)
- E2E testing infrastructure (Playwright)
- Speech recognition hooks (web/native)
- Backend auth enhancements

This is the stable version submitted to App Store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 20:28:18 -08:00
Sergei
966d8e2aba Various improvements and fixes
- Added ImageLightbox component for avatar viewing
- Updated beneficiary detail page with lightbox support
- Profile page improvements
- Bug page cleanup
- API and context updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-10 08:25:39 -08:00
Sergei
4c880190d5 Center subscription screen content when no active subscription 2026-01-09 20:02:55 -08:00
Sergei
61d275ec7c Remove role display from beneficiary detail header 2026-01-09 19:57:10 -08:00
Sergei
fc4567c690 Fix navigation: use /(tabs) instead of /(tabs)/beneficiaries
The main Beneficiaries tab is actually "index" not "beneficiaries".
/(tabs) routes to index which shows the beneficiaries list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:54:36 -08:00
Sergei
62f70853cb Fix navigation: add isNavigatingAway flag to prevent redirect conflicts
- Added isNavigatingAway state to block auto-redirects when user clicks back
- Both header back button and main button now set this flag before navigating
- Prevents loadBeneficiary from triggering competing redirects

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:52:39 -08:00
Sergei
c2c6a52b31 Try router.dismissAll() for navigation 2026-01-09 19:49:50 -08:00
Sergei
5489b16a13 Add Alert debug for Back button to diagnose issue 2026-01-09 19:49:21 -08:00
Sergei
657737e5a4 Add status badges for beneficiaries list
- Monitoring badge: equipment active + subscription active
- Get kit badge: user hasn't ordered equipment yet
- Equipment status badges: ordered, shipped, delivered
- No subscription warning when equipment works but no sub
- Stripe subscription caching in backend (hourly sync)
- BeneficiaryMenu with edit/share/archive/delete actions
2026-01-09 19:49:07 -08:00
Sergei
6e277ca940 Use Pressable instead of TouchableOpacity for Back button
TouchableOpacity inside ScrollView sometimes doesn't respond.
Pressable is more reliable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:47:46 -08:00
Sergei
a830383128 Fix navigation: use router.push for Back to Loved Ones
- Changed router.replace to router.push for better navigation
- Both header back button and main button now go to beneficiaries list
- Added console.log for debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:45:26 -08:00
Sergei
c004d3c3a4 Move "Back to Loved Ones" button above "I received my kit"
- Make "Back to My Loved Ones" the primary action (blue button)
- Make "I received my kit" secondary/subtle (gray, smaller)
- Prevents accidental confirmation of kit receipt
- Users can easily return to beneficiary list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:43:22 -08:00
Sergei
2d5e5186f7 Fix SplashScreen warning on subscription flow
- Add splashHidden flag to prevent double-hiding splash screen
- Add .catch() to preventAutoHideAsync to handle edge cases
- Fixes "No native splash screen registered" warning

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:21:53 -08:00
Sergei
e74d1a4b26 Show user role under beneficiary name
- Added role field to Beneficiary type
- Display role (Custodian/Guardian/Caretaker) in small gray text under name
- Role comes from user_access table via API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 19:08:12 -08:00
Sergei
28323507f8 Remove redirect from subscription page
Redirects should only happen on the main beneficiary page (index.tsx).
Other pages (subscription, equipment, share) just show their content
without redirecting - user navigated there intentionally via menu.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 18:50:13 -08:00
Sergei
973e9b7ebe Fix Developer Mode WebView authentication
- Add legacy dashboard API methods (eluxnetworks.net)
- Implement JWT token validation before using cached credentials
- Clear invalid tokens (non-JWT strings like "0") and force re-login
- Use correct credentials (anandk/anandk_8)
- Add 30-minute token refresh interval when WebView is active
- Fix avatar upload using expo-file-system instead of FileReader
- Handle address field as both string and object
2026-01-09 17:06:35 -08:00
Sergei
24e7f057e7 Stable version: Reusable BeneficiaryMenu, subscription fixes
- Created reusable BeneficiaryMenu component with Modal backdrop
- Menu closes on outside tap (proper Modal + Pressable implementation)
- Removed debug panel from subscription and beneficiary detail pages
- Fixed subscription creation and equipment status handling
- Backend improvements for Stripe integration
2026-01-09 13:22:56 -08:00
Sergei
e7831327bd Fix Stripe subscription flow - use SetupIntent
- Changed from PaymentIntent to SetupIntent flow
- SetupIntent always has client_secret (unlike incomplete subscriptions)
- Two-step process: collect payment method, then create subscription
- Added debug panel for troubleshooting (DEBUG_MODE=true)
- Updated price to $49/month (price_1SnYfkP0gvUw6M9C1095uFgW)
- Added react-native-root-toast dependency

Server changes (on 91.98.205.156):
- /create-subscription-payment-sheet: returns SetupIntent instead of subscription
- /confirm-subscription-payment: creates subscription with saved payment method
- Added safeTimestampToISO() to prevent "Invalid time value" errors
2026-01-08 22:16:22 -08:00
Sergei
06802c237b Improve subscription flow, Stripe integration & auth context
- Refactor subscription page with simplified UI flow
- Update Stripe routes and config for price handling
- Improve AuthContext with better profile management
- Fix equipment status and beneficiary screens
- Update voice screen and profile pages
- Simplify purchase flow
2026-01-08 21:35:24 -08:00
Sergei
fe4ff1a932 Simplify DB schema (name/address single fields) + subscription flow
Database:
- Simplified beneficiary schema: single `name` field instead of first_name/last_name
- Single `address` field instead of 5 separate address columns
- Added migration 008_update_notification_settings.sql

Backend:
- Updated all beneficiaries routes for new schema
- Fixed admin routes for simplified fields
- Updated notification settings routes
- Improved stripe and webhook handlers

Frontend:
- Updated all forms to use single name/address fields
- Added new equipment-status and purchase screens
- Added BeneficiaryDetailController service
- Added subscription service
- Improved navigation and auth flow
- Various UI improvements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-08 10:35:15 -08:00
Sergei
20be9a94c2 WIP: Navigation controller, subscription flow, and various improvements
- Add NavigationController for centralized routing logic
- Add useNavigationFlow hook for easy usage in components
- Update subscription flow with Stripe integration
- Simplify activate.tsx
- Update beneficiaries and profile screens
- Update CLAUDE.md with navigation documentation
2026-01-04 12:53:38 -08:00
Sergei
f4ff281bcc Improve invitation UI and fix access removal
- Move role selector (Caretaker/Guardian) above email input in Access screen
- Remove "(view only)" suffix from Caretaker role in email templates
- Remove "expires in 7 days" text from invitation emails
- Remove expires_at field from invitation creation (invitations never expire)
- Fix deletion of accepted invitations (now also removes user_access record)
- Add favicon to accept-invite.html page
2026-01-04 10:28:36 -08:00
Sergei
d0c4930d38 Update API, invitations, beneficiaries and UI components
- Enhanced invitations system with role management
- Updated beneficiaries routes and screens
- Improved activate, purchase and profile flows
- Added Maestro E2E tests
- Added web invite acceptance page
- Database migration for roles update
2026-01-03 13:02:10 -08:00
Sergei
f6a2d5e687 Replace Alert with Toast for invite code copy, rename Share to Access 2026-01-01 13:41:34 -08:00
Sergei
ad35dac850 Update beneficiaries layout and screens 2026-01-01 13:21:25 -08:00
Sergei
7186f29f35 Update activate, purchase and dashboard screens 2025-12-30 21:34:25 -08:00
Sergei
b869e9e3ab Update subscription, equipment screens and auth flow 2025-12-30 21:14:24 -08:00
Sergei
2545aec485 Add equipment status workflow to beneficiary cards
- BeneficiaryCard now shows equipment status badges (ordered/shipped/delivered)
- Added AwaitingEquipmentScreen with progress tracker
- "I received my kit" button to mark as delivered
- "Activate" button when equipment is delivered
- Fixed address field height in add-loved-one form

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-29 15:48:19 -08:00
Sergei
7cb07c09ce Major UI/UX updates: Voice, Subscription, Beneficiaries, Profile
- Voice tab: simplified interface, voice picker improvements
- Subscription: Stripe integration, purchase flow updates
- Beneficiaries: dashboard, sharing, improved management
- Profile: drawer, edit, help, privacy sections
- Theme: expanded constants, new colors
- New components: MockDashboard, ProfileDrawer, Toast
- Backend: Stripe routes additions
- Auth: activate, add-loved-one, purchase screens
2025-12-29 15:36:44 -08:00
Sergei
f73fbf4eca Fix auth flow, types stability, and stuck loading state. Streamline login process. 2025-12-27 16:05:45 -08:00
Sergei
b740762609 Update main project + add WellNuoLite
- WellNuoLite: облегчённая версия для модерации Apple
- Обновлены chat и voice tabs
- Добавлены TTS модели и сервисы
- Обновлены зависимости
2025-12-26 19:19:00 -08:00
Sergei
c80fd4ab4b Add Stripe checkout, OTP auth improvements, navigation updates
- Add purchase screen with real Stripe Checkout integration
- Add kit activation screen with dev mode notice
- Remove mock OTP mode - only serter2069@gmail.com bypasses OTP
- Fix OTP retry - show error without redirecting to email screen
- Update tab navigation: Dashboard, Chat, Profile (hide Voice)
- Update Brevo sender email to daterabbit.com domain

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 13:44:10 -08:00
Sergei
9475890d5a Fix voice picker modal - add minHeight for proper scrolling
- Changed voiceList style from flex: 1 to minHeight: 300
- Added backgroundColor and borderRadius for better visibility
- Now all 35+ voices are visible and scrollable in the DEV modal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 10:31:11 -08:00
Sergei
0b0b46ab3e Refactor auth to Email + OTP flow with dev bypass
- Convert login from username/password to email input
- Add OTP verification screen with auto-login for dev email
- Add dev email bypass (serter2069@gmail.com) using legacy anandk credentials
- Add saveEmail/getStoredEmail methods to API service
- Add email field to User type
- Clean up logout to also clear stored email

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-24 10:09:10 -08:00
Sergei
1a829a120f Fix voice picker scroll - add maxHeight and nestedScrollEnabled
ScrollView now properly scrolls through all 35+ voices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 18:13:58 -08:00
Sergei
40646622b8 Add DEV voice picker with 35+ languages for TTS testing
Voice assistant enhancements:
- DEV-only voice picker modal for testing TTS voices
- Support for 35+ languages: English variants, European, Asian, Middle Eastern
- Each voice can be tested with localized sample text
- Speech recognition enabled for voice input
- Continuous conversation mode with auto-listening

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 18:11:17 -08:00
Sergei
ec63a2c1e2 Add admin panel, optimized API, OTP auth, migrations
Admin Panel (Next.js):
- Dashboard with stats
- Users list with relationships (watches/watched_by)
- User detail pages
- Deployments list and detail pages
- Devices, Orders, Subscriptions pages
- OTP-based admin authentication

Backend Optimizations:
- Fixed N+1 query problem in admin APIs
- Added pagination support
- Added .range() and count support to Supabase wrapper
- Optimized batch queries with lookup maps

Database:
- Added migrations for schema evolution
- New tables: push_tokens, notification_settings
- Updated access model

iOS Build Scripts:
- build-ios.sh, clear-apple-cache.sh
- EAS configuration updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-20 11:05:39 -08:00
Sergei
ddfe5c7bd6 Add OTP-based email authentication flow
- Replace username/password login with email OTP flow
- Add verify-otp screen with 6-digit code input
- Add complete-profile screen for new users
- Update AuthContext with refreshAuth() method
- Add new API methods: requestOTP, verifyOTP, getMe, updateProfile
- Backend: wellnuo.smartlaunchhub.com

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 16:53:17 -08:00