feat(phase-2): discovery rows, social feed, achievements, workout & strength tracking - #225
Conversation
…ength tracking Phase 2 mobile-first features inspired by Uber Eats (discovery) and Strava (achievement + social). Plus mobile YouTube playback fix and image perf work already discussed. Mobile perf & playback (carried from earlier in branch): - Rewire YouTubePlayerModal to react-native-youtube-iframe with ID validation, watchdog timeout, error UI, and Linking fallback to the YouTube app. - Swap RN Image for expo-image (memory+disk cache, transition) in WorkoutCard and RecipeImage (native branch). Web paths untouched. - Downgrade YouTube thumbs to mqdefault on native; prefetch first 6 thumbs on Workouts/Recipes screens. keepPreviousData on recommended hooks. F1 — Recipe Discovery Rows: HorizontalRecipeRow component + useRecipesByTag hook; five themed carousels (Recommended, Quick, High protein, Trending, Plant-forward) replace the flat grid on Recipes. F2 — Smart Filter Chips: FilterChipBar with six multi-select chips (time, kcal, protein, diet, budget, saved) filters every row client-side. F3 — Log Again: LogAgainCard on Home dashboard surfaces last 7 days' meals, deduped to 3 most-recent unique names; useReLogMeal mutation re-logs at today's timestamp. F4 — Bottom-sheet detail pattern: reusable DetailBottomSheet primitive (slide-up modal w/ backdrop + drag handle); RecipeCard exposes onOpenDetail prop. F5 — Adaptive Home Hero: AdaptiveHomeHero morphs by time-of-day (morning / afternoon / evening / night) with personalized copy and CTAs. F6 — Achievements V2: AchievementsCard badge wall + useAchievements hook deriving 8 badges from existing data (streak, protein, veggies, cardio, hydration, macro mastery). Tap-to-detail sheet. F7 — Personal Records: PersonalRecordsCard + usePersonalRecords hook on Profile (longest streak, protein PR, most meals, on-target days, cleanest sodium). F8 — Weekly Summary: WeeklySummaryCard with totals, on-target days, PRs; native Share with formatted week recap. F9 — Friends & Activity Feed: FriendsFeedCard + useSocialStore (persistent, Zustand) with mock seed, kudos toggle, privacy flags per activity type. Ready to swap to a real backend feed endpoint when it lands. F10 — Challenges: ChallengesCard + useChallengeStore (persistent) with 4 templates (protein 5/7, breakfast 7, 4-in-14, calories in-range 10/30), progress bars, XP rewards. F11 — In-Workout Timer + Live Status Strip: useWorkoutSessionStore + floating WorkoutSessionStrip mounted at navigator root (persists across tabs). WorkoutCard gets a 'Start' button. F12 — Strength Sessions: StrengthLogModal w/ sets/reps/weight steppers + useStrengthLogStore with auto-PR detection via Epley 1RM. New 'Log strength' FAB on Workouts. F13 — Consistency Heatmap: ConsistencyHeatmap (GitHub-style 12-week grid) + useConsistencyCells hook on Profile. F14 — Day History: DayHistorySheet opens from any heatmap cell, shows that day's meals, strength sessions, and day score. Notes: - All UI follows the project's glass + orange/violet design system. - No backend schema changes; everything piggybacks on existing endpoints (meal-history, weekly-insights, recipes search, recommendations). - Local-only stores (social, challenges, strength, workout session) use Zustand + AsyncStorage. They expose stable APIs so a real backend can replace them later without touching components.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
aurafit | fb1bdee | Jun 28 2026, 09:57 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
aurafitness | fb1bdee | Jun 28 2026, 09:58 AM |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive suite of new features and UI components aimed at enhancing user engagement through gamification and social interaction. Key additions include an adaptive home hero card, a "Log Again" feature for quick meal entry, a Strava-style achievement and personal records system, joinable challenges, and a social feed with kudos. Technical improvements include the adoption of expo-image for optimized image caching, a new workout session tracking system with a persistent UI strip, and a GitHub-style consistency heatmap. The screens for Dashboard, Profile, Recipes, and Workouts have been significantly updated to integrate these new capabilities. I have no feedback to provide.
… Redis L2) as lookup fallback When the local food_nutrition table misses, fall back to the USDA FoodData Central API, cached two-level: in-process Caffeine (hot, recurring food vocab) + optional shared Redis (cross-instance, survives Cloud Run churn). Redis is optional/null-safe. Honest scope: density/ nutrition lookups, not the vision call. Tests: cache L1/L2/miss/redis-absent, client JSON parse, local-hit-skips-USDA.
…DAR) devices Adds ARScaleModule (native iOS) + useARScale hook: on ARKit devices without a depth sensor, raycast frame-center to a horizontal plane for camera-to-table distance -> img_w_cm, the same scale signal the LiDAR frame-processor emits (tier between LiDAR +-1cm and plate fallback +-5cm). Degrades to plate fallback when the native module is absent (never fabricates scale). Reference template -- ARKit raycasting needs a real device; capture-screen AR view wiring documented in README.
Reconcile with #225 (phase-2 discovery/social/tracking, already on main). Conflicts (all phase-2, taken from main as canonical): - DashboardScreen: username -> profile.displayName - DetailBottomSheet: onClose optional -> required - application.yml: keep the new gemini thinking-budget + nutrition.physics-refine block
- DashboardScreen: currentUser.data.username (UserProfileResponse has no displayName field, so #225's profile.displayName does not type-check). - DetailBottomSheet: onClose optional so the (title || onClose) guard compiles. Frontend tsc + 100 jest green; backend suite green.
Summary
Phase 2 mobile-first features inspired by Uber Eats (discovery-first) and Strava (achievement + social), plus the mobile YouTube playback fix and image-perf work discussed earlier in the session.
14 new features, 14 new components, 4 new Zustand stores, 3 new hooks. No backend schema changes — everything piggybacks on existing endpoints (
meal-history,weekly-insights,recipes/search-text,recommendations).What's in this PR
Mobile perf & playback fixes
YouTubePlayerModalnow usesreact-native-youtube-iframe(already inpackage.json) with ID validation, watchdog timeout, error UI, andLinkingfallback to the YouTube app — fixes the silent infinite-spinner.WorkoutCard+RecipeImage(native branch) migrated toexpo-image(memory+disk cache, transition).mqdefaulton native; prefetch top 6 thumbs on Workouts/Recipes screens.keepPreviousDataon recommended hooks so tab switches don't flash empty.Phase 2 features (Recipes)
HorizontalRecipeRow+useRecipesByTag.≤20min,≤500cal,High protein,Vegan,Budget,Saved) drives all rows client-side.FilterChipBar.DetailBottomSheetprimitive (slide-up modal w/ backdrop + drag handle);RecipeCardexposesonOpenDetailso taps open a sheet instead of pushing a route.Phase 2 features (Home dashboard)
LogAgainCardsurfaces last 7 days' meals (deduped to 3 most-recent unique names);useReLogMealmutation re-logs at today's timestamp.AdaptiveHomeHeromorphs by time-of-day (morning / afternoon / evening / night) with personalized copy + CTA.AchievementsCard) auto-derived from existing data viauseAchievements. Tap-to-detail sheet.WeeklySummaryCardw/ totals, on-target days, PRs + nativeShare.FriendsFeedCard+useSocialStore(Zustand, persisted) with mock seed, kudos toggle, per-activity privacy flags. Drop-in replacement when a real backend feed lands.ChallengesCard+useChallengeStore(persisted) with 4 templates (protein 5/7, breakfast 7-day, 4-in-14, calories in-range 10/30) — progress bars + XP rewards.Phase 2 features (Workouts)
useWorkoutSessionStore+ floatingWorkoutSessionStripmounted at navigator root (persists across tab switches).WorkoutCardgets a 'Start' button.StrengthLogModalwith sets/reps/weight steppers +useStrengthLogStorewith Epley 1RM auto-PR detection. New 'Log strength' FAB.Phase 2 features (Profile)
PersonalRecordsCard+usePersonalRecords(longest streak, protein PR, most meals, on-target days, cleanest sodium).ConsistencyHeatmap) +useConsistencyCells.DayHistorySheetshowing that day's meals + strength sessions + score.Files
New components (14):
AchievementsCard,AdaptiveHomeHero,ChallengesCard,ConsistencyHeatmap,DayHistorySheet,DetailBottomSheet,FilterChipBar,FriendsFeedCard,HorizontalRecipeRow,LogAgainCard,PersonalRecordsCard,StrengthLogModal,WeeklySummaryCard,WorkoutSessionStripNew stores (4):
useSocialStore,useChallengeStore,useWorkoutSessionStore,useStrengthLogStoreNew hooks (3):
useAchievements,usePersonalRecords,useConsistencyCellsModified:
RecipesScreen,DashboardScreen,WorkoutsScreen,ProfileScreen,RecipeCard,WorkoutCard,RecipeImage,YouTubePlayerModal,AppNavigator,useMealHistory,services/hooks, two index filesDesign constraints honored
#F97316) / violet-dark (#A78BFA) system.Test plan
cd frontend && npm install(pullsexpo-image+react-native-youtube-iframewhich were declared but not installed in this branch).npx tsc --noEmitis clean.npx expo startand verify on iOS + Android:Out of scope (deliberately)